开始学习 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. Hive 1、什么是Hive,Hive有什么用

    一.什么是Hive Hive是建立在 Hadoop 上的数据仓库基础构架.它提供了一系列的工具,可以用来进行数据提取转化加载(ETL),这是一种可以存储.查询和分析存储在 Hadoop 中的大规模数据 ...

  2. pyqt例子搜索文本

    #!/usr/bin/env python #-*- coding:utf-8 -*- import sip sip.setapi('QString', 2) sip.setapi('QVariant ...

  3. nmap 使用脚本引擎进行扫描

    1.下载nmap(nmap官网). 2.安装nmap. 3.编辑环境变量(windows下所需),保存.

  4. HDU 2689 sort it - from lanshui_Yang

    Problem Description You want to processe a sequence of n distinct integers by swapping two adjacent ...

  5. jQuery制作焦点图(轮播图)

    焦点图(轮播图) 案例 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:/ ...

  6. c#、sql数据库备份还原

    1.在项目中添加SQLDmo dll文件引用(SQLDMO(SQL Distributed Management Objects,SQL分布式管理对象)) 2在相应页面加using SQLDMO引用 ...

  7. C# 标签打印示例 1

    初次写博客,有哪些不足的地方,还请多多指点,给予建议,谢谢! 如若想要源码,请留言.        本实例是在Webservice 中通过excel做模板来打印标签.具体需求是:一个订单一页纸打印4行 ...

  8. CodeFirst Fluent API

    本文转自:疯狂的我  CodeFirst Fluent API EF的好处之一就是实现了概念模型和存储模型的分离,我们可以为概念实体和存储实体起不同的名称,同时还可以将一个概念实体映射到多个存储实体, ...

  9. 初识数据字典【weber出品必属精品】

    数据字典结构 有两部分组成: 1. 基表:以$结尾的系统表,在创建数据库的时候,oracle自动创建的表 2. 用户可以访问的视图 数据字典的种类 DICTIONARY:简称DICT,所有的数据字典, ...

  10. VC防止程序被多次运行 互斥体方法

    BOOL CXXXApp::InitInstance() //函数内添加代码 HANDLE hMutex=CreateMutex(NULL,TRUE,"test"); // 用于检 ...