出这个异常的原因是在项目中添加了新lication类(public class Application extends lication)之后,没有在AndroidManifest.xml中添加该类的声明,所以编译器抛出异常: java.lang.ClassCastException: android.app.Application cannot be cast to 类名
  <application android:icon="@drawable/icon" android:label="@string/app_name"
                android:name=".你所新建的lication类名">

java.lang.ClassCastException: android.app.Application cannot be cast to的更多相关文章

  1. java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.TextView

    最近在学习drawerLayout时,遇到这个bug.如下示: java.lang.ClassCastException: android.widget.RelativeLayout cannot b ...

  2. java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText

    Caused by: Java.lang.ClassCastException: Android.widget.TextView cannot be cast to android.widget.Ed ...

  3. 安卓出现错误: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText

    Caused by: Java.lang.ClassCastException: Android.widget.TextView cannot be cast to android.widget.Ed ...

  4. java.lang.ClassCastException:android.widget.Button cannot be cast to android.widget.ImageView

    今天遇到一个错误也不知道怎么回事,上网搜了一下: 出现的问题是:java.lang.ClassCastException:android.widget.Button cannot be cast to ...

  5. java.lang.ClassCastException: android.os.BinderProxy cannot be cast to com.test.Test

    由于我在第二个Activity中指定了进程名字,但是服务却没有指定进程名(默认跟主入口一个进程)所以报错. 网上找到的是 服务 和绑定服务的客户端必须在同一个application或者进程中,所以Ma ...

  6. Android: java.lang.ClassCastException: android.widget.imageView cannot be cast to android.widget.textView异常解决

    有时在修改xml文件时,全报这种错误,这个应该是缓存没得到及时更新导致的,可以通过以下方法解决: Eclipse tends to mess up your resources every now a ...

  7. 新建Application 报错android.app.Application cannot be cast

    我在开发APP的时候重新使用了一个类,继承了android.app.Application.但是在运行的时候提示java.lang.ClassCastException: android.app.Ap ...

  8. java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.L(转)

    09-09 10:19:59.979: E/AndroidRuntime(2767): FATAL EXCEPTION: main09-09 10:19:59.979: E/AndroidRuntim ...

  9. Exception: java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams

    RelativeLayout title_bg = (RelativeLayout)FTU_Bluetooth.this.findViewById(R.id.titlebar); LinearLayo ...

随机推荐

  1. oracle增加字段,循环

    alter table PARAMETETER_CONFIGURATION add (INPUT_IS VARCHAR2(20) ): declare sum_i int:=0; --定义整型变量,存 ...

  2. 如何利用wx.request进行post请求

    1,method 是  get  方式的时候,会将数据转换成 query string method 为 post 时,header为{"Content-Type": " ...

  3. ES6-三点运算符

    首先理解一下函数总的arguments变量,这个变量是函数内部自动生成的,他用来保存传入函数的实参,是一个伪数组. 例: function fun(a,b){ console.log(argument ...

  4. 吴裕雄 python 机器学习——数据预处理包裹式特征选取模型

    from sklearn.svm import LinearSVC from sklearn.datasets import load_iris from sklearn.feature_select ...

  5. Kettle-User Defined Java Class使用-大写转换

    一.大写转换 (1)步骤(表输入-Java脚本-表输出) (2)配置 1)表输入 2)java脚本 public boolean processRow(StepMetaInterface smi, S ...

  6. 【IO多路复用】

    " 目录 一.IO模型介绍 二.阻塞IO(blocking IO) 三.非阻塞IO(non-blocking IO) 四.多路复用IO(IO multiplexing) 五.异步IO(Asy ...

  7. 基于soa的架构

    SOA:Service Oriented Architecture面向服务的架构.也就是把工程拆分成服务层.表现层两个工程.服务层中包含业务逻辑,只需要对外提供服务即可.表现层只需要处理和页面的交互, ...

  8. Java学习资源 - 其他

    http请求HttpServletRequest详解 HttpServletRequest请求转发 高并发场景下的httpClient优化使用 HttpClien高并发请求连接池 - PoolingH ...

  9. POJ3662 Telephone Lines (dijkstra+二分)

    Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncoop ...

  10. 14.浏览器屏幕缩放bug修复

    问题:浏览器缩放时,轮播图显示不全,滚动水平滚动条,发现图片缺失 解决:隐藏水平滚动条,页面都只提供垂直滚动条的需求 global.css /* 水平超出部分默认隐藏 */ #app { overfl ...