新手安卓开发报错:很抱歉,xxxx程序已停止运行

时间:2022-06-09 17:01:44

是不是注册时出现问题
下面是我的注册内容
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.activitytest"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="14" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity 
            android:name=".FirstActivity"
            android:label="This is FirstActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity  android:name=".SencondActivity" >
            <intent-filter>
                <action android:name="com.example.activitytest.ACTION_START" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.example.activitytest.MY_CATEGORY" />
            </intent-filter>
        </activity>
        <activity  android:name=".ThirdActivity" >
            <intent-filter >
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="http" />
            </intent-filter>
       </activity>
    </application>

</manifest>

下面是输出的Log
05-05 02:53:05.401: D/dalvikvm(1117): Not late-enabling CheckJNI (already on)
05-05 02:53:06.481: D/gralloc_goldfish(1117): Emulator without GPU emulation detected.
05-05 02:53:07.301: D/AndroidRuntime(1117): Shutting down VM
05-05 02:53:07.301: W/dalvikvm(1117): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
05-05 02:53:07.311: E/AndroidRuntime(1117): FATAL EXCEPTION: main
05-05 02:53:07.311: E/AndroidRuntime(1117): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.activitytest/com.example.activitytest.SecondActivity}; have you declared this activity in your AndroidManifest.xml?
05-05 02:53:07.311: E/AndroidRuntime(1117):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1508)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at android.app.Activity.startActivityForResult(Activity.java:3190)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at android.app.Activity.startActivity(Activity.java:3297)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at com.example.activitytest.FirstActivity$1.onClick(FirstActivity.java:43)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at android.view.View.performClick(View.java:3480)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at android.view.View$PerformClick.run(View.java:13983)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at android.os.Handler.handleCallback(Handler.java:605)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at android.os.Handler.dispatchMessage(Handler.java:92)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at android.os.Looper.loop(Looper.java:137)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at android.app.ActivityThread.main(ActivityThread.java:4340)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at java.lang.reflect.Method.invokeNative(Native Method)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at java.lang.reflect.Method.invoke(Method.java:511)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-05 02:53:07.311: E/AndroidRuntime(1117):  at dalvik.system.NativeStart.main(Native Method)

6 个解决方案

#1


{com.example.activitytest/com.example.activitytest.SecondActivity}; have you declared this activity in your AndroidManifest.xml?这句话

#2


<activity  android:name=".SencondActivity" >
            <intent-filter>
                <action android:name="com.example.activitytest.ACTION_START" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.example.activitytest.MY_CATEGORY" />
            </intent-filter>
        </activity>

里面name拼写错误,改为SecondActivity

#3


引用 2楼haomai007 的回复:
<activity  android:name=".SencondActivity" >
            <intent-filter>
                <action android:name="com.example.activitytest.ACTION_START" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.example.activitytest.MY_CATEGORY" />
            </intent-filter>
        </activity>

里面name拼写错误,改为SecondActivity
十分感谢

#4


引用 1楼qq_29637837 的回复:
{com.example.activitytest/com.example.activitytest.SecondActivity}; have you declared this activity in your AndroidManifest.xml?这句话
十分感谢

#5


<activity  android:name=".SencondActivity" >  改为<activity  android:name=".SecondActivity" >

#6


楼主在吗,怎么查看和修改注册内容啊

#1


{com.example.activitytest/com.example.activitytest.SecondActivity}; have you declared this activity in your AndroidManifest.xml?这句话

#2


<activity  android:name=".SencondActivity" >
            <intent-filter>
                <action android:name="com.example.activitytest.ACTION_START" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.example.activitytest.MY_CATEGORY" />
            </intent-filter>
        </activity>

里面name拼写错误,改为SecondActivity

#3


引用 2楼haomai007 的回复:
<activity  android:name=".SencondActivity" >
            <intent-filter>
                <action android:name="com.example.activitytest.ACTION_START" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.example.activitytest.MY_CATEGORY" />
            </intent-filter>
        </activity>

里面name拼写错误,改为SecondActivity
十分感谢

#4


引用 1楼qq_29637837 的回复:
{com.example.activitytest/com.example.activitytest.SecondActivity}; have you declared this activity in your AndroidManifest.xml?这句话
十分感谢

#5


<activity  android:name=".SencondActivity" >  改为<activity  android:name=".SecondActivity" >

#6


楼主在吗,怎么查看和修改注册内容啊