开发者社区> 问答> 正文

我创建了对话框,如果单击“同意”按钮,则当我们再次打开应用程序时它将不会显示关闭

.setCancelable(true)
.setPositiveButton( "AGREE", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int id) {
        dialog.cancel();

    }
} )
.setNeutralButton( "PRIVACY POLICY", new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
        Intent intent = new Intent( MainActivity.this, PrivacyPolicy.class );
        startActivity( intent );
    }
} )
.setNegativeButton( "DENY", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int id) {
        dialog.dismiss();
    }

} );
AlertDialog alert = builder.create();
alert.show();

展开
收起
几许相思几点泪 2019-12-05 15:42:37 441 0
0 条回答
写回答
取消 提交回答
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载