I would like to do this:
From activity A start activity B. In activity B before it ends (when I press home or back button – I use “protected void onStop()” method), save data to DB (sqlite).
And now I am back in activity A and I would like to reload data from DB (I use “protected void onRestart()” method). But there is my problem – when I load data from DB, I get old data (not new data, that was saved before activity B was ended).
Can you help me, where can be problem? Thanks.
I believe that onRestart on activity A may be called before onStop on activity B. Yopu can put a Log.d() just to check.
If this is the case, you can move the save to DB on activity B to the onPause() instead od onStop() and the issue will be fixed.