How can I maintain UI state of my previous state in android? -
explanation:
i have 2 fragments , 1 activity. have gone 1 fragment fragment , first fragment visible activity.
in first fragment oncreateview() method called api call. after call data set data listview. when click on 1 of rows of listview second fragment becomes visible. working fine till now.
problem
when click on button of device second fragment previous fragment visible api call has been started.
how can stop refresh ui of first fragment when press button?
for more detail see instagram android application.
if using addtobackstack() maintain fragment state , call replace() method call second fragment first fragment in case every time when pressed button second fragment oncreateview() method of first fragment called.
so solution call api in onattach() or oncreate() method.
hope you.
Comments
Post a Comment