android - Replacing fragments quickly causes a weird screenshot of the previous fragment to persist and brought forward -
i'm using homeactivity replaces fragments dynamically , adds content frame layout dynamically user selected items drawer. on each fragment, loads feed network renders. here code use switch -
public void loadfragment(fragment frag, string tag) { fragmentmanager fragmentmanager = getsupportfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fragmenttransaction.replace(r.id.content_fragment, frag, tag); try { fragmenttransaction.commit(); } catch (illegalstateexception e) { logger.error(tag, "failed commit fragment transaction... ", e); } }
now if switch between these fragment drawer (drawerlayout being used) , not let network request each fragment complete, somehow new fragment replaced placed underneath screenshot of old fragment while loading. since old fragment showing values cache, shows partial feed.
now if notice top of stack has feed new fragment , has layers should bottom of stack has appears screenshot of previous fragment , seemingly screenshot / partial draw in root view z-indexed higher new feed reason , overshadows it. not interact , interestingly enough i'm able scroll new feed z-index below (though highest layer in picture above) overlay.
i've tried traverse view hierarchy root view , print out , not able find text of screenshot elements (which why think image or sort of optimization being done third party library? we're using swipetorefresh also). i'm confused , how rid of it. doesn't happen if switch fragments , let load. clues?
Comments
Post a Comment