So what I am trying to do is save the current progress made by the user in Textviews.java through sharedPreferences. E.g. the activity contains several textviews and the user types in them. When the user presses back, it should save the current state of what is typed in the textviews. And once the user presses the exit button on Main.java, an alert dialog comes up asking the user if he would like to save what he typed. If he selects yes, then it saves and the app closes, if not then it doesn't save and the app closes.
So far I have managed to save what the user does when he presses back when inside Textviews.java but I have several questions regarding how to commit the save when the alert dialog comes up when the user press 'yes' on the alert dialog. And also, loading the data when the user goes back to the Textviews activity.
I have a couple of questions regarding sharedPreferences. 1) Throughout the WHOLE app, can it only have one sharedPreference() object to store their data in? Or can there be multiple objects. If multiple objects is allowed, then does 1 activity essentially get one sharePreference object or can one activity have several sahrepreference objects to store their data? 2) How can I access other activities shared preference datas? 3) How can I know if a sharedpreference file exists?