android - Call same fragment with different data -
i have fragment in display response details of user, , response contains information other users(same json structure) , clicking on link inflate same fragment(with different instance) displays information , goes on , on fine till here. when press key last instance previous fragment not displayed , last fragment nth user data keeps on displaying.
eg. fragment a->(click on b profile)->fragment b profile->(click on c profile)fragment c profile
when backpress
fragment c profile->fragment c profile-> app closes.
and i'm adding fragment backstack following code.
ft.add(r.id.home_container_fl, basefragment).addtobackstack(fragment.class.getsimplename()).commit(); i'm using event bus same can affect behaviour?
how can fix same?
one solution create different instances of fragment each own data. isn't ideal since might create lots , lots of instances. however, straightforward. once working, can go , try find solution more efficient memory.
Comments
Post a Comment