Suppose that the app check if the start is her first run, with the following code:
public class MyActivity extends Activity {
SharedPreferences prefs = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Doing things
prefs = getSharedPreferences("com.example.myAppName", MODE_PRIVATE);
}
@Override
protected void onResume() {
super.onResume();
if (prefs.getBoolean("firstrun", true)) {
// Do first run stuff here then set 'firstrun' as false
// using the following line to edit/commit prefs
prefs.edit().putBoolean("firstrun", false).commit();
}
}}
Suppose now that this application is updated through Google Play, when the app runs again, that code will consider it his first start? Sahred Preferences are deleted in the update process?
Thank you for your time,
Flagg.