I have spent quite a while trying to get rid of this flicker and was hoping someone could point me in the right direction. Not sure what code to post so if you don't mind i will post whatever is asked for.
The issue is that when i press back or home the activity closes but then for a split second it flashes (flickers) back on the screen then is gone again. sometimes the flicker is very quick and not very noticeable but other times its a little longer (maybe a full second). It happens on emulator and actual device. Happens on Android 4.4+, Android 5.0+ and 6.0+ Devices
I have tried removing things from manifest, styles, onbackpressed, onpause, onstop, etc...
What i have is a AppCompatActivity with many fragments. Im using the Theme.AppCompat.Light.NoActionBar theme and a toolbar with navigation drawer.
Like i said i know im not posting much code but not sure where to start. I have searched this site for this issue and can't find anything related so not sure what parts of my code to post.
You can try calling
overridePendingTransition(0, 0)
when your main activity finishes, i.e, in either of the onPause() or onBackPressed() method of your AppCompatActivity. Also make sure all your fragments are getting destroyed, you may have to manually remove the fragments by calling
fragmentTransaction.remove(fragment).commit()
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments