• <tfoot id='crw15'></tfoot>

    <small id='crw15'></small><noframes id='crw15'>

    <legend id='crw15'><style id='crw15'><dir id='crw15'><q id='crw15'></q></dir></style></legend>
    <i id='crw15'><tr id='crw15'><dt id='crw15'><q id='crw15'><span id='crw15'><b id='crw15'><form id='crw15'><ins id='crw15'></ins><ul id='crw15'></ul><sub id='crw15'></sub></form><legend id='crw15'></legend><bdo id='crw15'><pre id='crw15'><center id='crw15'></center></pre></bdo></b><th id='crw15'></th></span></q></dt></tr></i><div id='crw15'><tfoot id='crw15'></tfoot><dl id='crw15'><fieldset id='crw15'></fieldset></dl></div>
      • <bdo id='crw15'></bdo><ul id='crw15'></ul>

        在 Android App 中的应用程序启动时仅显示一次版本

        时间:2023-08-30
        • <i id='uqPYU'><tr id='uqPYU'><dt id='uqPYU'><q id='uqPYU'><span id='uqPYU'><b id='uqPYU'><form id='uqPYU'><ins id='uqPYU'></ins><ul id='uqPYU'></ul><sub id='uqPYU'></sub></form><legend id='uqPYU'></legend><bdo id='uqPYU'><pre id='uqPYU'><center id='uqPYU'></center></pre></bdo></b><th id='uqPYU'></th></span></q></dt></tr></i><div id='uqPYU'><tfoot id='uqPYU'></tfoot><dl id='uqPYU'><fieldset id='uqPYU'></fieldset></dl></div>

            <tfoot id='uqPYU'></tfoot>

            <small id='uqPYU'></small><noframes id='uqPYU'>

            <legend id='uqPYU'><style id='uqPYU'><dir id='uqPYU'><q id='uqPYU'></q></dir></style></legend>
                <tbody id='uqPYU'></tbody>

                <bdo id='uqPYU'></bdo><ul id='uqPYU'></ul>

                  本文介绍了在 Android App 中的应用程序启动时仅显示一次版本信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想显示一个带有确定按钮的简单信息对话框,关于此版本中的新功能,但它应该只在第一次启动时显示.实现这一点的最佳方法是什么?

                  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 ?

                  推荐答案

                  我会(并且已经)使用带有 boolean 或 int 值的 SharedPreferences.只需检查最后一个版本是否比当前版本旧并更新 int.这是一个不错的小片段.

                  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
                          }
                  

                  这篇关于在 Android App 中的应用程序启动时仅显示一次版本信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:MapView 在对话框中显示较暗的地图 下一篇:创建自定义对话框时出现问题

                  相关文章

                  最新文章

                    <bdo id='PomTZ'></bdo><ul id='PomTZ'></ul>
                  <i id='PomTZ'><tr id='PomTZ'><dt id='PomTZ'><q id='PomTZ'><span id='PomTZ'><b id='PomTZ'><form id='PomTZ'><ins id='PomTZ'></ins><ul id='PomTZ'></ul><sub id='PomTZ'></sub></form><legend id='PomTZ'></legend><bdo id='PomTZ'><pre id='PomTZ'><center id='PomTZ'></center></pre></bdo></b><th id='PomTZ'></th></span></q></dt></tr></i><div id='PomTZ'><tfoot id='PomTZ'></tfoot><dl id='PomTZ'><fieldset id='PomTZ'></fieldset></dl></div>

                  1. <legend id='PomTZ'><style id='PomTZ'><dir id='PomTZ'><q id='PomTZ'></q></dir></style></legend>

                    <small id='PomTZ'></small><noframes id='PomTZ'>

                    <tfoot id='PomTZ'></tfoot>