I´d like to show a simple information dialog with an Ok-Button, about whats new in this version, but it should show only at the first start. Whats the best way to implement this ?
+1
A:
A number of solutions are documented here:
http://stackoverflow.com/questions/3608483/what-is-sharedpreferences-in-android/3608517#3608517
fredley
2010-08-31 20:35:02
A:
with a boolean variable stored somewhere : preferences, DB, SD card, ..
youssef azari
2010-08-31 20:36:40
+1
A:
I would (and have) used a SharedPreferences with a boolean or int value. Simply check if the last version is older than the current version and update the int. Here's a nice little snipit.
//check to see if we need to show whats new or not
SharedPreferences config = getSharedPreferences(MY_PREFS_STRING, 0);
int lastVersion = config.getInt(KEY_VERSION, -1);
if(currentVersion > lastVersion ){
showDialog(id);
//set this as lastVersion
}
smith324
2010-08-31 20:39:37