Skip to content Skip to sidebar Skip to footer

Ghost Behavior When Pausing Activity While Fragment Replace Transaction With Custom Animation Is Running

I am using fragment transactions to switch between components on a button press. To make the overall experience better I added custom animations to animate the old fragment out to

Solution 1:

Try calling executePendingTransactions() after calling commit().

 supportFragmentManager.beginTransaction()
.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left)
.replace(R.id.fragment_container, contentModel.contentFragment, CONTENT_FRAGMENT_TAG)
.commit()
.executePendingTransactions()

Post a Comment for "Ghost Behavior When Pausing Activity While Fragment Replace Transaction With Custom Animation Is Running"