0

I am trying for such a popup which will show up as a starting screen (like an agreement) , I know i can do the same thing with help of preference so that it wont show up again. But i want same popup to be showed only next time the app is updated.How can i do change the preference only when the app is updated?

unitedartinc
  • 738
  • 1
  • 6
  • 25

1 Answers1

0

You can get the VersionName as follows :

PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
String version = pInfo.versionName;

And get the CodeVersion doing :

int CodeVersion = pInfo.versionCode;

And then compare it every time and if it's different show the popup message.

You have more information on this question

Community
  • 1
  • 1
Skizo-ozᴉʞS ツ
  • 19,464
  • 18
  • 81
  • 148