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

The method setOnClickListener(View.OnClickListener) in the 
type View is not applicable for the arguments (new OnClickListener(){})

解决方法:

增加一个导入

import android.view.View.OnClickListener;

The method setOnClickListener(View.OnClickListener) in the type View is not applicable的更多相关文章

  1. 错误: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 ...

  2. The method setClass(Context, Class<?>) in the type Intent is not applicable for the arguments (GameV

    在当前短信内容的activity中写            Bundle bun = new Bundle();         bun.putString("message",  ...

  3. The method load(Class, Serializable) in the type HibernateTemplate is not applicable for the arguments (Class, int)

    引入别人的项目发现利用HibernateTemplate的load的方法报错了.错误提示为: The method load(Class, Serializable) in the type Hibe ...

  4. The method format(String, Object[]) in the type String is not applicable for the arguments

    今天,我弟遇到一个有意思的错误~ 程序: package com.mq.ceshi1; public class StringFormat { public static void main(Stri ...

  5. The method makeText(Context, CharSequence, int) in the type Toast is not applicable for the arguments (new View.OnClickListener(){}, String, int)

    package comxunfang.button; import android.support.v7.app.ActionBarActivity; import android.os.Bundle ...

  6. .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 ...

  7. The method onClick(View) of type new View.OnClickListener(){} must override a superclass

    最近在做一个jWebSocket Android客户端的Demo时遇到如下错误: ok —————— 最近在做一个jWebSocket Android客户端的Demo时遇到如下错误: ".. ...

  8. onClick(View) of type new View.OnClickListener(){} must override a superclass method

    原地址:http://blog.csdn.net/aeolus1019/article/details/8014798 Android开发过程中代码错误报错如下: - implements andro ...

  9. eclise -The method onClick(View) of type new View.OnClickListener(){} must override a superclass method

    在做arcgis android开发的时候,突然遇到这种错误,The method onClick(View) of type new View.OnClickListener(){} must ov ...

随机推荐

  1. poj 2376 Cleaning Shifts(贪心)

    Description Farmer John <= N <= ,) cows to <= T <= ,,), the first being shift and the la ...

  2. CentOS7 定时检测进程占用内存大小,执行重启进程操作(xjl456852原创)

    在使用CentOS时,个别程序的进程会一直增大,直到宕机.但是这种程序本身有没有更好的版本使用(比如ngrok免费就这样,付费的就没这个问题),所以想写一个脚本定时检测一下这个程序的情况,决定是否需要 ...

  3. Django之Cookie与Session

    一.cookie 1.cookie使用 def cookie(request): print(request.COOKIES) # 获取所有的COOKIES obj = render(request, ...

  4. unity的坑

    http://dearymz.blog.163.com/blog/static/20565742013341916919/ 编辑器: Hierarchy窗口中是场景中的Game Object列表 Pr ...

  5. 随着时间的推移:构造SDK路径错误(An error occurred while automatically activating bundle com.android.ide.eclipse.adt)

    在进行Android应用的开发过程中,有时候在配置SDK路径的时候(Windows->Preferences->Android).会出现例如以下报错:An error occurred w ...

  6. IO中手机旋转事件的传递

    UIApplication -> delegate -> widnow -> rootViewController

  7. playbin2 成员

    1. playbin2   struct _GstPlayBin {   GstPipeline parent;   GMutex *lock; GstSourceGroup groups[2]; G ...

  8. .NET基础拾遗(4)委托为何而生?

    生活中的例子: 你早上要吃包子作为早饭,那么你可能让你爸爸或者妈妈帮你做,那你就会调用 爸爸.要包子() 或妈妈.要包子() 返回包子对象. 但是如果你爸妈不在家的时候,你只能去街上买,问题是你根本不 ...

  9. FineUI控件之树的应用(二)

    一.Tree控件应用 <f:PageManager ID="PageManager1" runat="server" /> <f:Tree I ...

  10. gitolite随记

    1.git clone源码 git clone git://github.com/sitaramc/gitolite 2.安装 gitolite/install -ln 3.建立git仓库 gitol ...