I have two activities
Menu (Activiy)
Contents: Button1 —-> When this is pressed (a new intent is created and shows up Submenu),
Button2, and
Button3
Submenu (Activity)
Contents: Contains an async task (called on onCreate()) that downloads information and loads a scrollview.
Also Contains 3 togglebuttons
When I go to the Menu everything loads up perfectly. Then I press Button1 which also loads up the Submenu and does the Asynctask. However, when I go back to Menu and press Button1 again, nothing is saved on the ScrollView of Submenu of and everything is reset to original.
What can i do to fix this?
thank you for your time and effort
When you firstly execute the
AsyncTask, you should save the data somewhere. Then every next time, you can check if there are any data available. If yes, setup theScrollViewand continue, else execute theAsyncTask.Hope this helps!