How to have a one-time only Dialog box
I am wondering how one woul开发者_JAVA技巧d create a dialog box that only pops up when the app is first opened. For example, I have an Android app on the market. When I update it, I would like to implement a box that pops up that displays what has been updated in the app and will not pop up again until the app is updated again. Thanks!
Save a version number (string) to the preferences file and query for it in the onCreate method.
If the version string matches the current version string then just proceed with the application without any action.
If the version string does not match the current version string then display the dialog.
I hope that makes sense.
If you need some sample code as well - have a look at
Is this the first run?
Could be easily adapted to fit your needs, I think
精彩评论