http://blog.csdn.net/xiaoyuan511/article/details/17114761

关于android创建对话框报错The method setPositiveButton(int, DialogInterface.OnClickListener) in the type Alert

原创  2013年12月04日 10:43:35
  • 1284

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


Here is your solution, you did a silly mistake there buddy.

It should not be

.setNegativeButton("Don't Remind", new OnClickListener() 

It should be

.setNegativeButton("Don't Remind", new DialogInterface.OnClickListener()
只要这样写,就不报错了!本人水平有限,也不知道什么原因,希望对你能有帮助!

更多相关文章

  1. Android中RelativeLayout的字符水平(垂直居中)对齐
  2. LinearLayout水平居中控制
  3. Android自定义对话框(Dialog)
  4. 常用的android弹出对话框
  5. Android 实现 选择文件对话框
  6. LinearLayout中实现水平方向上的两个textview一个居左,一个居右的
  7. Android UI学习 - 对话框
  8. Android中创建对话框(确定取消对话框、单选对话框、多选对话框)
  9. 《Android面试宝典》学习笔记(第四章:对话框、信息提示和菜单)

随机推荐

  1. android:添加usb键盘+按键布局和映射的修
  2. android的helloworld工程目录学习
  3. Android第一行代码学习笔记六----手机多
  4. 【翻】Android(安卓)Design Support Libr
  5. Hander
  6. Android学习-我所整理的学习资料
  7. Android下C开发
  8. android Studio 使用gradle 参数解释及多
  9. [置顶] Android BaseAdapter
  10. 连接服务器超时的Demo