HimeAnator Member Licensed User Longtime User May 14, 2013 #1 I have an activity where the user inputs information into text fields along with an image box that when the user clicks it brings up the gallery and they can select an image and they are returned back to the activity and the image box is then updated with the picture they just selected. However on some devices when the user selects their image and are returned back to the activity all the information they typed in has been reset and the image they selected does not show up either. :sign0163:
I have an activity where the user inputs information into text fields along with an image box that when the user clicks it brings up the gallery and they can select an image and they are returned back to the activity and the image box is then updated with the picture they just selected. However on some devices when the user selects their image and are returned back to the activity all the information they typed in has been reset and the image they selected does not show up either. :sign0163:
Erel B4X founder Staff member Licensed User Longtime User May 15, 2013 #2 The activity might be killed when it is not visible. See these links: StateManager - Helps managing Android applications settings and state Android Process and activities life cycle Upvote 0
The activity might be killed when it is not visible. See these links: StateManager - Helps managing Android applications settings and state Android Process and activities life cycle
HimeAnator Member Licensed User Longtime User May 15, 2013 #3 Right now I have no code in Activity_Pause So would I add Code: Sub Activity_Pause (UserClosed As Boolean) StateManager.SaveSettings End Sub and Resume the activity with Code: StateManager.RestoreState(Activity, "Main", 0) and this will keep the activity from resetting? Thank you for your help. Upvote 0
Right now I have no code in Activity_Pause So would I add Code: Sub Activity_Pause (UserClosed As Boolean) StateManager.SaveSettings End Sub and Resume the activity with Code: StateManager.RestoreState(Activity, "Main", 0) and this will keep the activity from resetting? Thank you for your help.