-1

I need to display release notes after every update just no the first run. How can I implement that?

124697
  • 22,097
  • 68
  • 188
  • 315
  • Simple update the SharedPreference for First time application open. – user370305 Jun 27 '13 at 09:11
  • possible duplicate of [Android: How to reset FirstRun SharedPreferences when my app is updated?](http://stackoverflow.com/questions/4726283/android-how-to-reset-firstrun-sharedpreferences-when-my-app-is-updated) – GHC Jun 27 '13 at 09:12

2 Answers2

2

you can read the version number of your manifest with this:

String pkgName = mContext.getPackageName();
int versionCode = mContext.getPackageManager().getPackageInfo(pkgName, 0).versionCode;

save it (in SharedPreferences for example) and compare the two values when the app is launched

VinceFR
  • 2,551
  • 1
  • 21
  • 27
0

Add in your code checking of some new key - for example:

if (preferences.contains("update-1.1"){
  // first start after update
  // ...
  preferences.edit().putBoolean("update-1.1").commit();
} else{
  // not first start
}
Dimmerg
  • 2,113
  • 1
  • 13
  • 14