I would suggest using SharedPreferences , which is similar to option 2. which allows you to get the content identifier (or a string or json object) after closing the application. you can also encrypt the content identifier before putting it in sharedPreferences
Besides intention (ram) and local storage (rom / sdcard, including the database), I do not see any other option (locally).
Case 1: you need to resume work after closing the application
you must use local storage
Case 2: you do not need to resume work after closing the application
option 1: 0. load the first activity 1. start login_activity (startActivityForResult()) (do not call finish() ) 2. after login is done (call finish()) 3. activity is resumed (if login fail -> redirect to other activity ) option 2: 1. create a public class with a data member to save the content-id/activity class (you may assign singleton design pattern)
alvin choi 28
source share