类型转换异常处理java.lang.RuntimeException

前几天在做一个安卓项目的时候一直报java.lang.RuntimeException错,一直调试不出来,今天突然又灵感是不是文件配置出错了,果然在清单文件中少了一句 android:name=".KXApplication"。

02-05 10:19:52.429: E/AndroidRuntime(16026): java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.tianfang1314.c/cn.tianfang1314.c.activity.MainActivity}: java.lang.ClassCastException: android.app.Application cannot be cast to cn.tianfang1314.c.KXApplication

解决方式:添加一行配置信息:android:name=".KXApplication"。

时间: 2024-09-20 16:49:51

类型转换异常处理java.lang.RuntimeException的相关文章

Android中调用startActivity结果导致:java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}

Android中调用startActivity结果导致:上网查了一下,总结如下: 第一种情况:java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPointerException 错误代码: private int defaultDrawable=R.drawable.radio; private String defaultTitle=getString(R.string.

WebService CXF版本频繁调用时,出现java.lang.RuntimeException: org.apache.c

问题描述 java.lang.RuntimeException:org.apache.cxf.interceptor.Fault:异常org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:102)org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInter

FAILED: Hive Internal Error: java.lang.RuntimeException(Error while making MR scratch directory异常的解决

hive> select * from dummy; FAILED: Hive Internal Error: java.lang.RuntimeException(Error while making MR scratch directory - check filesystem config (null)) java.lang.RuntimeException: Error while making MR scratch directory - check filesystem config

安卓开发闪退-安卓开发中java.lang.RuntimeException: Unable to start activity ComponentInfo问题

问题描述 安卓开发中java.lang.RuntimeException: Unable to start activity ComponentInfo问题 package com.example.test; import android.app.ActivityGroup;import android.app.LocalActivityManager;import android.content.Intent;import android.os.Bundle;import android.vi

nutch Exception in thread "main" java.lang.RuntimeException: job failed: name=ge

问题描述 stone@stone-virtual-machine:~/apache-nutch-2.2.1/runtime/local$bin/nutchcrawlurls/seed.txt-dircrawl-depth3-topN5InjectorJob:Usingclassorg.apache.gora.memory.store.MemStoreastheGorastorageclass.InjectorJob:totalnumberofurlsrejectedbyfilters:0Inje

Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi

错误信息字符串:Java.lang.RuntimeException: Unable to start activity ComponentInfo{com.first/com.first.Game}: java.lang.NullPointerException 一般都会在Activity  onCreate()方法里的setContentView(XXX)发生此错误,网上查阅了很多原因,大概有四种重要可能的原因: 原因一:xxx的错误,若为R.layout.main  那么应该是main.x

我的Android进阶之旅------>Android中MediaRecorder.stop()报错 java.lang.RuntimeException: stop failed.

今天在调用MediaRecorder.stop(),报错了,java.lang.RuntimeException: stop failed. E/AndroidRuntime(7698): Cause by: java.lang.RuntimeException: stop failed. E/AndroidRuntime(7698): at android.media.MediaRecorder.stop(Native Method) E/AndroidRuntime(7698): at co

nutch 2.2.1 运行报错InjectorJob: java.lang.RuntimeException: job failed: name=inject

问题描述 在windows下的eclipse中运行报错,如下,求各位大神帮帮忙,本人小白一个,急急急急InjectorJob:startingat2014-06-2615:45:36InjectorJob:InjectingurlDir:urlsInjectorJob:Usingclassorg.apache.gora.memory.store.MemStoreastheGorastorageclass.****file:/D:/workspace/nutchTest/urlsInjectorJ

java.lang.RuntimeException: java.net.ConnectException: Connection timed out: con

问题描述 报这个错误java.lang.RuntimeException:java.net.ConnectException:Connectiontimedout:connectatorg.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.java:346)atorg.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.java