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原生项目整合ReactNative
  2. AndroidVirtual Devices (AVD)创建、设置
  3. Android之十一实现登陆页面分析
  4. 创建 cocos2d-x+lua for android 步骤
  5. Android(安卓)布局中 如何使控件居中
  6. Android中RelativeLayout的字符水平(垂直居中)对齐
  7. LinearLayout水平居中控制
  8. Android(安卓)4高级编程(第3版)》
  9. Android(安卓)Dialog的使用

随机推荐

  1. Android中的AIDL
  2. Android自动解除系统锁屏
  3. android进程间服务通信示例
  4. Android(安卓)Activity之间跳转与传值
  5. Android 实现记住用户名和密码的功能
  6. 在Linux下安装Android SDK
  7. adb logcat命令查看并过滤android输出log
  8. android 上下文菜单Context Menu--折腾一
  9. Unity调用高德地图API,获取定位信息(Androi
  10. cocos2d for android 项目的部署