diff options
author | Nancy Chen <nancychen@google.com> | 2015-07-01 18:06:39 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-01 18:06:40 +0000 |
commit | e343d33c8757a7eb41bfd07f21fa2af0c5152cf6 (patch) | |
tree | 0818144afc8fd0cf5cf571cdd75db667f1ada175 | |
parent | 465ae0eabc9ee6afce10dbb53789ead8800d519f (diff) | |
parent | d5de03bcc20fcdb667fdc9d0eb56f0d6c57da0c8 (diff) |
Merge "Ensure the EXTRA_SHOW_TAB is checked for all new intents." into mnc-dev
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 13 | ||||
-rw-r--r-- | src/com/android/dialer/list/ListsFragment.java | 4 |
2 files changed, 12 insertions, 5 deletions
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(); } diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java index e45da0ce0..33c977670 100644 --- a/src/com/android/dialer/list/ListsFragment.java +++ b/src/com/android/dialer/list/ListsFragment.java @@ -347,6 +347,10 @@ public class ListsFragment extends Fragment return mRemoveView; } + public int getTabCount() { + return mViewPagerAdapter.getCount(); + } + private int getRtlPosition(int position) { if (DialerUtils.isRtl()) { return mViewPagerAdapter.getCount() - 1 - position; |