0

我正在调用我当前班级的另一个意图。它抛出异常,如:

android.content.ActivityNotFoundException:未找到处理 Intent { act=com.example.nirbhaya.DefaultDetails } 的活动

完整的异常日志是:

05-29 13:36:18.898: I/ApplicationPackageManager(17992): cscCountry is not German : INU
05-29 13:36:19.226: D/dalvikvm(17992): GC_EXTERNAL_ALLOC freed 45K, 49% free 2775K/5379K, external 408K/517K, paused 83ms
05-29 13:36:19.265: I/Splash-Activity(17992): at TRY
05-29 13:36:19.820: W/IInputConnectionWrapper(17992): showStatusIcon on inactive InputConnection
05-29 13:36:22.265: I/Splash-Activity(17992): Coming HERE...............
05-29 13:36:22.273: W/System.err(17992): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.example.nirbhaya.DefaultDetails }
05-29 13:36:22.281: W/System.err(17992):    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1409)
05-29 13:36:22.281: W/System.err(17992):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
05-29 13:36:22.281: W/System.err(17992):    at android.app.Activity.startActivityForResult(Activity.java:2827)
05-29 13:36:22.281: W/System.err(17992):    at android.app.Activity.startActivity(Activity.java:2933)
05-29 13:36:22.281: W/System.err(17992):    at com.example.nirbhaya.Splash$1.run(Splash.java:28)

请帮我解决问题。

我的代码是:

飞溅.java

package com.example.nirbhaya;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class Splash extends Activity{
    private static final String TAG = "Splash-Activity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);

        Thread timer = new Thread(){
            public void run(){
                try{
                    Log.i(TAG, "at TRY");
                    sleep(3000);
                }
                catch(InterruptedException e){
                    e.printStackTrace();                    
                }finally{
                    Log.i(TAG,"Coming HERE...............");
                    Intent openStartingPoint = new Intent ("com.example.nirbhaya.DefaultDetails");
                    try {
                        startActivity(openStartingPoint);
                    } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    } 

                }
            }
        };
        timer.start();

    }


}

Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.nirbhaya"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />
    <uses-permission android:name="android.permission.SEND_SMS"/>

    <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.nirbhaya.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=".DefaultDetails" android:label="@string/app_name" android:screenOrientation="portrait" >
    </activity>
     <activity android:name=".MainActivity" android:label="@string/app_name" android:screenOrientation="portrait" >
    </activity>
    <activity android:name=".DefSms" android:label="@string/app_name" android:screenOrientation="portrait" >
    </activity>
    <activity android:name=".Sms" android:label="@string/app_name" android:screenOrientation="portrait" >
    </activity>
    <activity android:name=".Email" android:label="@string/app_name" android:screenOrientation="portrait" >
    </activity>
    </application>

</manifest>
4

3 回答 3

2

ActivityNotFoundException意味着你错过了在文件中声明你ActivityMainActivityAndroidManifest.xml

于 2013-05-29T07:59:46.453 回答
0

尝试改变:

Intent openStartingPoint = new Intent ("com.example.nirbhaya.MainActivity");

Intent openStartingPoint = new Intent (getApplicationContext(), DefaulDetails.class);
于 2013-05-29T08:05:35.127 回答
0

在 mainfaist 中添加这一行

<activity android:name=".splash" android:label="@string/app_name" >
</activity>
于 2013-05-29T08:30:45.840 回答