Skip to content

Commit

Permalink
Remove intent extra MainActivity.EXTRA_SHOW_PAGE after consuming it
Browse files Browse the repository at this point in the history
  • Loading branch information
philliphsu committed Sep 24, 2016
1 parent d0f4069 commit 5414c95
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/com/philliphsu/clock2/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ public void onClick(View view) {

final int initialPage = getIntent().getIntExtra(EXTRA_SHOW_PAGE, -1);
if (initialPage >= 0 && initialPage <= mSectionsPagerAdapter.getCount() - 1) {
// This is so we don't keep it around when the configuration changes.
getIntent().removeExtra(EXTRA_SHOW_PAGE);
// Run this only after the ViewPager is finished drawing
mViewPager.post(new Runnable() {
@Override
Expand Down

0 comments on commit 5414c95

Please sign in to comment.