From d5de03bcc20fcdb667fdc9d0eb56f0d6c57da0c8 Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Wed, 1 Jul 2015 09:20:45 -0700 Subject: Ensure the EXTRA_SHOW_TAB is checked for all new intents. onNewIntent is only called when the activity is already active so when an intent is sent to start the DialtactsActivity on a specific tab when the DialtactsActivity is not already active, the code to switch to the specific tab is not called. Move this code to onResume() instead. Bug: 21120186 Change-Id: I735eae22ca5de54f4c17688777b4309616f2c691 --- src/com/android/dialer/DialtactsActivity.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/com/android/dialer/DialtactsActivity.java') diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index b8a1d4dce..ba1b8d163 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -545,6 +545,14 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O prepareVoiceSearchButton(); mDialerDatabaseHelper.startSmartDialUpdateThread(); mFloatingActionButtonController.align(getFabAlignment(), false /* animate */); + + if (getIntent().hasExtra(EXTRA_SHOW_TAB)) { + int index = getIntent().getIntExtra(EXTRA_SHOW_TAB, ListsFragment.TAB_INDEX_SPEED_DIAL); + if (index < mListsFragment.getTabCount()) { + mListsFragment.showTab(index); + } + } + Trace.endSection(); } @@ -906,11 +914,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mStateSaved = false; displayFragment(newIntent); - if (newIntent.hasExtra(EXTRA_SHOW_TAB)) { - mListsFragment.showTab( - getIntent().getIntExtra(EXTRA_SHOW_TAB, mListsFragment.TAB_INDEX_SPEED_DIAL)); - } - invalidateOptionsMenu(); } -- cgit v1.2.3