参考资料:

http://blog.csdn.net/competerh_programing/article/details/7377950

在创建Dialog的时候,出现:

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

的错误提示。解决方法:

将代码:

bulider.setPositiveButton("确定", new OnClickListener() {

换成:

bulider.setPositiveButton("确定", new DialogInterface.OnClickListener() {

即可解决问题

同样,.setNegativeButton()也如此处理即可

The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder i的更多相关文章

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

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

  2. The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, SettingFragment, String)

    The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the ...

  3. android-The method findViewById(int) is undefined for the type ContactMainFragment报错

    @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view ...

  4. must implement the inherited abstract method DialogInterface.OnClickListener.onClick(DialogInterface, int)问题

    依照视屏编写代码如下 class MyButtonListener implements OnClickListener{ @Override public void onClick(View v){ ...

  5. .replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is not app

    提示错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arg ...

  6. 错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, MyFragment)

    Fragment newfragment =new MyFragment();fragmentTransaction.replace(R.layout.activity_main,newfragmen ...

  7. The method setOnClickListener(View.OnClickListener) in the type View is not applicable

    开始学习 android 了,学习的是高明鑫老师的android视频教程(android视频教学). 学到第八讲时, 在写动态设置时报错: The method setOnClickListener( ...

  8. new DialogInterface.OnClickListener()报错的解决办法

    在项目过程中 new DialogInterface.OnClickListener()总是报下面的错 Illegal qualified access from the type parameter ...

  9. The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

    The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory 这是由于项目里面的一些 ...

随机推荐

  1. Migrating Your Android App from Eclipse to Android Studio

    By: Jason Snell | Posted in: Mobile, Performance Tech Tips, Top Post, Jun. 7th, 2013 12 inShare One ...

  2. inline-block空隙怎么解决

    方法一:移除空格 元素间留白间距出现的原因就是标签段之间的空格,因此,去掉HTML中的空格,自然间距就木有了.考虑到代码可读性,显然连成一行的写法是不可取的,我们可以: <div class=& ...

  3. (转)使用OpenGL显示图像(六)响应触摸事件

    响应触摸事件 编写:jdneo - 原文:http://developer.android.com/training/graphics/opengl/touch.html 让对象根据预设的程序运动(如 ...

  4. tp5.0如何获取header的Authorization值

    tp5.0如何获取header的Authorization值$request->header();好像没有这个值的但是发送请求头部有的 解决方案: 在.htaccess 文件中加入 设置 Set ...

  5. spring MVC 返回值信息和ResponseBody的响应json数据

    spring mvc的界面返回: 如果我们定义的返回类型是String 那么我们返回的时候直接写入 我们的界面的名字就可以了  springmvc会自动去找到我们的界面,如果是void类型的返回那么 ...

  6. EmWin 如何显示汉字 不用在文件中使用编码

    1. Font Converter for emWin 生成C文件字库 1.1 新建文件 1.2 选择字体 1.3 为了减小C文件体积,这里只加入自己需要的汉字,先把所有字体取消选择. 1.4 新建一 ...

  7. windbg show args after breakpoint

    bp ntdll!NtOpenFile ".echo ####################;du poi(ebp+8);.echo ########################;&q ...

  8. Vue环境搭建及第一个helloWorld

    Vue环境搭建及第一个helloWorld 一.环境搭建 1.node.js环境安装配置  https://www.cnblogs.com/liuqiyun/p/8133904.html 或者 htt ...

  9. Idea添加Tomcat

    1.菜单栏Run--Edit Configurations: 点击Defaults查看有没有Tomcat Server,没有的话点左上角+,有的话进入步骤2,没有的话进入步骤3. 2.点击左侧Tomc ...

  10. mysql 5.7.20 从frm文件中得到建表语句 (使用 mysql-utilities)

    系统环境  centos 7.2    mysql社区版 5.7.20 mysql-utilities 根据官网的说法,截止到2018年5月30日,实用工具的一些功能在Shell的路线图中,鼓励用户迁 ...