参考资料:

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. delphi 以系统权限运行程序的代码

    program sysrun; uses Windows, SysUtils, tlhelp32, AccCtrl, AclAPI; function findprocess(TheProcName: ...

  2. python 国内镜像加速

    原因 经常在使用Python的时候需要安装各种模块,而pip是很强大的模块安装工具但是由于国外官方默认pip访问速度慢,经常被墙,导致无法安装,所以我们最好是将自己使用的pip源更换一下,这样就能解决 ...

  3. ibatis 中的 $和#的区别

    在sql配置中比如in(#rewr#) 与in ($rewr$) 在Ibatis中我们使用SqlMap进行Sql查询时需要引用参数,在参数引用中遇到的符号#和$之间的区分为,#可以进行与编译,进行类型 ...

  4. 字母加密-C基础

    输入一个英文小写字符和正整数k(k<26),将英文字母加密并输出.加密思想:将每个字母c加一个序数k, 即用它后面的第k个字母代替,变换公式:c = c + k.如果字母为z,则后一个字母是a, ...

  5. 2015 ACM-ICPC 亚洲区上海站 A - An Easy Physics Problem (计算几何)

    题目链接:HDU 5572 Problem Description On an infinite smooth table, there's a big round fixed cylinder an ...

  6. VC2008中处理CStatic控件的单击STN_CLICKED消息

    在MFC中,静态文本CStatic控件主要是用来作为标签,即作为注释用的.一般情况下不做消息响应.但是有时特殊情况下会做一些消息响应,比如处理单击事件STN_CLICKED等. 在VC2008下使用M ...

  7. jmeter 不同线程组之间传递变量2

    方法1  通过变量传递参数: 第一个脚本: HTTP Request_新建出差申请单_登录,关联出参数token.companyId.userId.userName 1.添加后置处理器:BeanShe ...

  8. Mysql 主从同步(转载)

    第一步: 在master上创建用于同步的用户 GRANT FILE,REPLICATION SLAVE,REPLICATION CLIENT,SUPER ON *.* TObackup@'192.16 ...

  9. Optparse 简介

    optparse 这个库的主要作用是可以用为脚本提供传递命令参数功能 一个简单的例子 def main(): parser = OptionParser(usage = "usage: %p ...

  10. python 3和python 2 的不同之 f - strings

    python3.6版本及以上版本才能使用 f "{}{}{}" f-string 格式化输出