Android : Android maintain activity state with data

on Monday, February 16, 2015


I have 2 different activities. MainActivity, ContactList & ContactDetails. Now from MainActivity user will tap on Add new and application will open ContactList screen from where user can select any contact to see details which opens ContactDetails activity. Now if user select any no. from ContactDetails, application will go back to MainActivity and add the selected no. in arraylist. I am able to add the data but my problem is that whenever add new record old records are erased. I found the reason that evertime i open MainActivity from ContactDetails it creates new Activity. So i am looking for a way to use OnResume or OnResult Method to solve the problem.


0 comments:

Post a Comment