Hello Everyone, I had do a search on activity retain state.So I am getting to options/solutions for that:-
- Using savedInstanceState() and retainInstanceState() methods.
- Using Parent Child hierarchy declare in manifest and its working. (Example Url:-How can I return to a parent activity correctly? I had same problem mention in Note scetion of the answer.That case is match with my problem.
So,I want to retain the activity states just like Whats app(call/chats/contacts fragments).
- But In My scenario,I am fetching the contacts from server.So how can I persist my data while switching between chat and my fragment activity?
- So while timing to fetch new data of my contact list from server.I want to save ui of my listview/recyclerview with old data previously I had.
Also suggest which method is good from above two methods or need to implement in other way.