Reset menu every transaction

This commit is contained in:
topjohnwu 2017-01-30 01:51:55 +08:00
parent d30397e9c0
commit 2dddb8df69

View File

@ -180,6 +180,7 @@ public class MainActivity extends AppCompatActivity
private void displayFragment(@NonNull Fragment navFragment, String tag, boolean setElevation) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
invalidateOptionsMenu();
transaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
transaction.replace(R.id.content_frame, navFragment, tag).commitNow();
if (setElevation) toolbar.setElevation(toolbarElevation);