android保持对话框打开,直到用户单击按钮

时间:2015-05-26 16:56:36

标签: java android

我有以下代码来显示对话框。我们的要求是用户在登录应用程序之前已经更新了应用程序。

new AlertDialog.Builder(LoginSlider.this)
    .setTitle("Update is Available!")
    .setMessage("Please update your app to use new features")
    .setPositiveButton("Update now", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
               final String appPackageName = getPackageName();
               startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
               }
            })
    .setIcon(android.R.drawable.ic_dialog_alert)
    .show();

enter image description here

当我单击对话框的一侧时。它会消失。我不希望这样。我怎么能这样做?

0 个答案:

没有答案
相关问题