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());
|
mamageNewIntent(getIntent());
|
||||||
if (savedInstanceState == null && !menuWasSelected) {
|
if (savedInstanceState == null) {
|
||||||
navigationView.setCheckedItem(R.id.nav_home);
|
navigationView.setCheckedItem(R.id.nav_home);
|
||||||
navigationView.getMenu().performIdentifierAction(R.id.nav_home, 0);
|
navigationView.getMenu().performIdentifierAction(R.id.nav_home, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -614,6 +614,8 @@ public class Helper {
|
||||||
.cacheOnDisk(true).resetViewBeforeLoading(true).build();
|
.cacheOnDisk(true).resetViewBeforeLoading(true).build();
|
||||||
imageLoader = ImageLoader.getInstance();
|
imageLoader = ImageLoader.getInstance();
|
||||||
NavigationView navigationView = (NavigationView) activity.findViewById(R.id.nav_view);
|
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);
|
updateHeaderAccountInfo(activity, account, navigationView, imageLoader, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -640,11 +642,16 @@ public class Helper {
|
||||||
activity.startActivity(myIntent);
|
activity.startActivity(myIntent);
|
||||||
activity.finish(); //User is logged out to get a new token
|
activity.finish(); //User is logged out to get a new token
|
||||||
}else {
|
}else {
|
||||||
ownerStatus.setText(String.valueOf(account.getStatuses_count()));
|
if (ownerStatus != null)
|
||||||
ownerFollowers.setText(String.valueOf(account.getFollowers_count()));
|
ownerStatus.setText(String.valueOf(account.getStatuses_count()));
|
||||||
ownerFollowing.setText(String.valueOf(account.getFollowing_count()));
|
if (ownerFollowers != null)
|
||||||
username.setText(String.format("@%s",account.getUsername()));
|
ownerFollowers.setText(String.valueOf(account.getFollowers_count()));
|
||||||
displayedName.setText(account.getDisplay_name());
|
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);
|
imageLoader.displayImage(account.getAvatar(), profilePicture, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue