java.lang.RuntimeException

作者:滴水穿石 | 创建时间: 2023-08-10
05-21 10:03:03.916: E/AndroidRuntime(18573): FATAL EXCEPTION: main 05-21 10:03:03.916: E/AndroidRuntime(18573): java.lan...
java.lang.RuntimeException

操作方法

一般出现这个问题主要是没有在项目的androidManifest.xml里注册使用activity,主要就是这句: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.tomato/com.example.alarmtest.AppStart}: java.lang.ClassNotFoundException: com.example.alarmtest.AppStart

上面它已经就说,你没有实例化com.example.tomato/com.example.alarmtest.AppStart,tomato是项目名字,AppStart是没有实例化的activity。这就明白了,检查这下,注册 <activity android:name="com.example.tomato.AppStart"/>。

但有时你发觉你已经注册,这时你要仔细检查,看看是不是包名写错了,仔细排查错误。就能解决了。

点击展开全文

更多推荐