From bed1b4fa7ae3f9a4a546f2aa367a8f2e7ba4b7b1 Mon Sep 17 00:00:00 2001 From: Mindy Pereira Date: Mon, 14 Nov 2011 13:00:39 -0800 Subject: [PATCH] Highlight the first result for search. Fixes b/5614128 Email doesn't auto display first search result after result list appears Change-Id: I1843471bc3fe018151ed2a30ceb3e19eb2af24e9 --- src/com/android/email/activity/MessageListFragment.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/android/email/activity/MessageListFragment.java b/src/com/android/email/activity/MessageListFragment.java index 4a3d48727..12a1fbb07 100644 --- a/src/com/android/email/activity/MessageListFragment.java +++ b/src/com/android/email/activity/MessageListFragment.java @@ -1320,6 +1320,13 @@ public class MessageListFragment extends ListFragment mIsRefreshable = cursor.mIsRefreshable; mCountTotalAccounts = cursor.mCountTotalAccounts; + // If this is a search result, open the first message. + if (UiUtilities.useTwoPane(getActivity()) && mIsFirstLoad && mListContext.isSearch() + && cursor.getCount() > 0) { + cursor.moveToFirst(); + onMessageOpen(getMailboxId(), cursor.getLong(MessagesAdapter.COLUMN_ID)); + } + // Suspend message notifications as long as we're resumed adjustMessageNotification(false);