0

每当我更改 AndroidManifest.xml 文件中的默认活动时,都会出现调试错误并显示:

'Thread [<1> main] (Suspended (exception RuntimeException)) 
<VM does not provide monitor information>   
ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2249    
ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2299 
ActivityThread.access$700(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 154    
ActivityThread$H.handleMessage(Message) line: 1284  
ActivityThread$H(Handler).dispatchMessage(Message) line: 99 
Looper.loop() line: 137 
ActivityThread.main(String[]) line: 5306    
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  
Method.invoke(Object, Object...) line: 511  
ZygoteInit$MethodAndArgsCaller.run() line: 1102 
ZygoteInit.main(String[]) line: 869 
NativeStart.main(String[]) line: not available [native method]  

Thread [<10> Binder_2] (Running)    
Thread [<9> Binder_1] (Running) '

然后在共享区域中,它显示“未找到源”,并带有一个“编辑源查找路径”按钮。我的 Android 清单看起来像这样

    '<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tobidae.problem"
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=".Splash"
        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=".MainMenu"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.tobidae.problem.MAINMENU" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>   
</manifest>'

谢谢...

4

1 回答 1

0

如果您继续您的程序(在您的 IDE 上按“继续”),将引发异常,您将能够在 LogCat 中读取它。“未找到源”错误意味着异常是由 Android 框架代码生成的,而不是在您的类中;这可能意味着它找不到指定的活动(或无法实例化类)并引发异常。

于 2013-10-19T18:57:13.093 回答