My issue is, I am creating below view dynamically.
My problem is how do I store the values of each edit text in a structured way in shared preferences like below.
etc.
Why I want to store the values in the shared preferences is because, Once the user navigates to some other page after entering all the details about organization and jobs, and then if he/she returns back to the same page, all the previously entered details(Organization and Job details) must be there.
Please suggest me how to do it, any ideas will be highly appreciated.
Thanks.
I would create an Organization Class which will look something likse this:
Class Organization {
String name;
ArrayList<String> jobsList;
}
Then I would add the needed info from your UI, serialize the object and save it to SharedPerfrences:
Gson gson = new Gson();
String dataToSave = gson.toJson(organization);
//save the data using SharedPerfrences