12-11 02:45:59.232: E/AndroidRuntime(348): FATAL EXCEPTION: main
12-11 02:45:59.232: E/AndroidRuntime(348): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ass.ui/com.ass.ui.Settings}: java.lang.InstantiationException: com.ass.ui.Settings
12-11 02:45:59.232: E/AndroidRuntime(348): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
12-11 02:45:59.232: E/AndroidRuntime(348): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-11 02:45:59.232: E/AndroidRuntime(348): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-11 02:45:59.232: E/AndroidRuntime(348): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-11 02:45:59.232: E/AndroidRuntime(348): at android.os.Handler.dispatchMessage(Handler.java:99)
12-11 02:45:59.232: E/AndroidRuntime(348): at android.os.Looper.loop(Looper.java:123)
12-11 02:45:59.232: E/AndroidRuntime(348): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-11 02:45:59.232: E/AndroidRuntime(348): at java.lang.reflect.Method.invokeNative(Native Method)
12-11 02:45:59.232: E/AndroidRuntime(348): at java.lang.reflect.Method.invoke(Method.java:521)
12-11 02:45:59.232: E/AndroidRuntime(348): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-11 02:45:59.232: E/AndroidRuntime(348): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-11 02:45:59.232: E/AndroidRuntime(348): at dalvik.system.NativeStart.main(Native Method)
12-11 02:45:59.232: E/AndroidRuntime(348): Caused by: java.lang.InstantiationException: com.ass.ui.Settings
12-11 02:45:59.232: E/AndroidRuntime(348): at java.lang.Class.newInstanceImpl(Native Method)
12-11 02:45:59.232: E/AndroidRuntime(348): at java.lang.Class.newInstance(Class.java:1429)
12-11 02:45:59.232: E/AndroidRuntime(348): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
12-11 02:45:59.232: E/AndroidRuntime(348): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
12-11 02:45:59.232: E/AndroidRuntime(348): ... 11 more
這是我的Logcat錯誤,下面是android清單文件。這工作昨天,我沒有改變一個字母,現在錯誤仍然存在。Android清單文件活動錯誤
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ass.ui"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.ass.ui.Main"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ass.ui.Settings"
android:configChanges="orientation"
android:label="@string/app_name"
android:noHistory="true"
android:screenOrientation="portrait" >
</activity>
</application>
</manifest>
似乎我不知道我在哪裏錯了。 Tnx尋求幫助。
你可以用意向發佈startActivity的代碼嗎? –
你好...把 intent-filter>標籤放在 它會解決你的問題。 –