I assume that you start the emulator when you start the emulator, you have the option to โerase saved dataโ when you start it, so it will be like how you started it, as if you just started the application. In addition, you can enter the settings โ Applications โ You application โ Wipe data.
As for your encoding solution, at the moment I donโt have anything convenient, but what you need to do is start your main activity, start a procedure / function to check if the sharedpreference file is empty, and if it starts working with preference, otherwise follow the main action. Alternatively, instead of checking that the file is empty, you can see if the value you are looking for for input by the user (e.g. UserID) is null or not. If this value is not null, it means that the application can continue.
Sorean
source share