Android: First run popup dialog

前端 未结 6 2184
感情败类
感情败类 2020-12-04 11:50

I am trying to make a popup dialog that only shows after the app\'s first run that will alert users of the new changes in the app. So I have a dialog popup like this:

<
6条回答
  •  孤城傲影
    2020-12-04 12:17

    While the general idea of the other answers is sound, you should keep in the shared preferences not a boolean, but a timestamp of when was the last time the first run had happened, or the last app version for which it happened.

    The reason for this is you'd likely want to have the first run dialog run also whenthe app was upgraded. If you keep only a boolean, on app upgrade, the value will still be true, so there's no way for your code code to know if it should run it again or not.

提交回复
热议问题