diff --git a/app/src/main/java/org/kontalk/ui/AbstractComposeFragment.java b/app/src/main/java/org/kontalk/ui/AbstractComposeFragment.java index 56fdc6244..c8ec338fe 100644 --- a/app/src/main/java/org/kontalk/ui/AbstractComposeFragment.java +++ b/app/src/main/java/org/kontalk/ui/AbstractComposeFragment.java @@ -1076,12 +1076,10 @@ private AudioFragment getAudioFragment() { FragmentActivity parent = getActivity(); if (parent != null) { fragment = new AudioFragment(); - FragmentManager fm = parent.getSupportFragmentManager(); + FragmentManager fm = getFragmentManager(); fm.beginTransaction() .add(fragment, "audio") .commit(); - // commit immediately please - fm.executePendingTransactions(); } } diff --git a/app/src/main/java/org/kontalk/ui/ComposeMessage.java b/app/src/main/java/org/kontalk/ui/ComposeMessage.java index 281700cd8..4e19b4c76 100644 --- a/app/src/main/java/org/kontalk/ui/ComposeMessage.java +++ b/app/src/main/java/org/kontalk/ui/ComposeMessage.java @@ -134,11 +134,10 @@ protected boolean isNormalUpNavigation() { private void setComposeFragment(@NonNull AbstractComposeFragment f) { mFragment = f; - FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); - ft.replace(R.id.fragment_compose_message, f); - ft.setTransition(FragmentTransaction.TRANSIT_NONE); - ft.commitAllowingStateLoss(); - getSupportFragmentManager().executePendingTransactions(); + getSupportFragmentManager().beginTransaction() + .replace(R.id.fragment_compose_message, f) + .setTransition(FragmentTransaction.TRANSIT_NONE) + .commitNowAllowingStateLoss(); } @Override