Correctly navigate to the Updates view from notification.
This commit is contained in:
parent
77f3a5feff
commit
7b77919432
@ -410,7 +410,8 @@ class NotificationHelper {
|
||||
|
||||
// Intent to open main app list
|
||||
Intent intentObject = new Intent(context, MainActivity.class);
|
||||
PendingIntent piAction = PendingIntent.getActivity(context, 0, intentObject, 0);
|
||||
intentObject.putExtra(MainActivity.EXTRA_VIEW_UPDATES, true);
|
||||
PendingIntent piAction = PendingIntent.getActivity(context, 0, intentObject, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
NotificationCompat.Builder builder =
|
||||
new NotificationCompat.Builder(context)
|
||||
|
@ -56,6 +56,7 @@ public class MainActivity extends AppCompatActivity implements BottomNavigationV
|
||||
|
||||
private RecyclerView pager;
|
||||
private MainViewAdapter adapter;
|
||||
private BottomNavigationView bottomNavigation;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -70,7 +71,7 @@ public class MainActivity extends AppCompatActivity implements BottomNavigationV
|
||||
pager.setLayoutManager(new NonScrollingHorizontalLayoutManager(this));
|
||||
pager.setAdapter(adapter);
|
||||
|
||||
BottomNavigationView bottomNavigation = (BottomNavigationView) findViewById(R.id.bottom_navigation);
|
||||
bottomNavigation = (BottomNavigationView) findViewById(R.id.bottom_navigation);
|
||||
bottomNavigation.setOnNavigationItemSelectedListener(this);
|
||||
|
||||
initialRepoUpdateIfRequired();
|
||||
@ -102,6 +103,7 @@ public class MainActivity extends AppCompatActivity implements BottomNavigationV
|
||||
if (getIntent().hasExtra(EXTRA_VIEW_UPDATES)) {
|
||||
getIntent().removeExtra(EXTRA_VIEW_UPDATES);
|
||||
pager.scrollToPosition(adapter.adapterPositionFromItemId(R.id.updates));
|
||||
bottomNavigation.findViewById(R.id.updates).performClick();
|
||||
}
|
||||
|
||||
// AppDetails 2 and RepoDetailsActivity set different NFC actions, so reset here
|
||||
|
Loading…
x
Reference in New Issue
Block a user