The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder i

The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder i本佩奇刚步入安卓的新人,开发的过程中遇到的问题都记录在自己的博客当中,不喜勿喷。出自CSDN中,链接忘了。在创建Dialog的时候,出现ThemethodsetPositiveButton(int,DialogInterface.OnClickListener)inthetypeAlertDialog.Builderisnotapplicableforthearg…

本佩奇刚步入安卓的新人,开发的过程中遇到的问题都记录在自己的博客当中,不喜勿喷。出自CSDN中,链接忘了。

在创建Dialog的时候,出现

The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder is not applicable for the arguments (int, new View.OnClickListener(){})

的错误。查找资料后解决问题。

AlertDialog.Builder builder = new AlertDialog.Builder(this);

builder.setPositiveButton(R.string.vc_dialogTrue, new OnClickListener(){}

代码中的

new OnclickListener()

更改为

new DialogInterface.OnClickListener()

后解决问题。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/37686.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注