It's 7am and i've been searching all night long on this. I got a Nav drawer and list which dynamically adds fragments to Main activity and switchs to the clicked fragment.
I'm new so let me try be explaing what i tried:
When i first started this project it was fine, now i have black flashs whenever i switch and i can't find any reasons. I thought it was "heavy" work in the onCreate of the fragments, but other than loading views and setting their texts/images there isn't much more work, other than 1 fragment which contains a timer i got 4 others who do nothing but present data.
1 of the fragments is completely empty in code, and it also flashs.
- i had animation in the transaction, but it used to work, not anymore, flashs. i tried removing it but i still get the flashs.
- I've read about SurfaceView but it seems too complicated for my project which is just a simple time&money tracker.
important notes: when i click the Back button there's no flash and the animation runs smoothly. I'm testing on my own device which is Galaxy s5.
What i've read so far that didn't help: Whole screen turns into black for a short while when first switching between Fragment and MapFragment
** I think i have a lead: The flickering could be caused by the closeDrawer i have called right after i commit a new fragment. when the drawer is open, the ui behind it is dimmed, i disabled that close call and when i change fragments no flickering.
i don't know how to fix it tho.