Fixes some crashes when clicking on a notification
This commit is contained in:
parent
18da5dde02
commit
7992f6e133
|
@ -148,9 +148,8 @@ public class MainActivity extends AppCompatActivity
|
|||
}
|
||||
});
|
||||
|
||||
boolean menuWasSelected = false;
|
||||
mamageNewIntent(getIntent());
|
||||
if (savedInstanceState == null && !menuWasSelected) {
|
||||
if (savedInstanceState == null) {
|
||||
navigationView.setCheckedItem(R.id.nav_home);
|
||||
navigationView.getMenu().performIdentifierAction(R.id.nav_home, 0);
|
||||
}
|
||||
|
|
|
@ -614,6 +614,8 @@ public class Helper {
|
|||
.cacheOnDisk(true).resetViewBeforeLoading(true).build();
|
||||
imageLoader = ImageLoader.getInstance();
|
||||
NavigationView navigationView = (NavigationView) activity.findViewById(R.id.nav_view);
|
||||
navigationView.getMenu().clear();
|
||||
navigationView.inflateMenu(R.menu.activity_main_drawer);
|
||||
updateHeaderAccountInfo(activity, account, navigationView, imageLoader, options);
|
||||
}
|
||||
|
||||
|
@ -640,10 +642,15 @@ public class Helper {
|
|||
activity.startActivity(myIntent);
|
||||
activity.finish(); //User is logged out to get a new token
|
||||
}else {
|
||||
if (ownerStatus != null)
|
||||
ownerStatus.setText(String.valueOf(account.getStatuses_count()));
|
||||
if (ownerFollowers != null)
|
||||
ownerFollowers.setText(String.valueOf(account.getFollowers_count()));
|
||||
if (ownerFollowing != null)
|
||||
ownerFollowing.setText(String.valueOf(account.getFollowing_count()));
|
||||
if (username != null)
|
||||
username.setText(String.format("@%s",account.getUsername()));
|
||||
if (displayedName != null)
|
||||
displayedName.setText(account.getDisplay_name());
|
||||
imageLoader.displayImage(account.getAvatar(), profilePicture, options);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue