申请流程意外停止

时间:2014-02-21 12:42:28

标签: android

我是android的新手,所以我不知道如何解释这个logcat我搜索了这个网站,但没有找到任何解决方案,我面临的问题。一点点帮助将是appriciated.thank提前。 Android清单

<?xml version="1.0" encoding="utf-8"?>               
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.splashscreen"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="8
     />
<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="com.splashscreen.StartingPoint"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.splashscreen.STARTINGPOINT" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity android:name="com.splashscreen.Menu"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MENU" />               <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>

Log cat :
    02-21 17:24:21.026: W/dalvikvm(447): threadid=9: thread exiting with uncaught exception (group=0x40015560) 
02-21 17:24:21.026: E/AndroidRuntime(447): FATAL EXCEPTION: Thread-10 02-21          17:24:21.026: E/AndroidRuntime(447): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.splashscreen.MENU }    02-21 17:24:21.026:E/AndroidRuntime(447): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
02-21 17:24:21.026: E/AndroidRuntime(447):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
02-21 17:24:21.026: E/AndroidRuntime(447):  at android.app.Activity.startActivityForResult(Activity.java:2827)
02-21 17:24:21.026: E/AndroidRuntime(447):  at android.app.Activity.startActivity(Activity.java:2933)
02-21 17:24:21.026: E/AndroidRuntime(447):  at com.splashscreen.Splash$1.run(Splash.java:31)

Splash.java

 package com.splashscreen;
 import android.app.Activity;
 import android.content.Intent;
 import android.media.MediaPlayer;
 import android.os.Bundle;
 public class Splash extends Activity {
 MediaPlayer ourSong;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);

    ourSong = MediaPlayer.create(Splash.this, R.raw.splashsound);
    ourSong.start();

    Thread timer = new Thread(){
        public void run(){
            try{
                sleep(5000);
            }catch(InterruptedException e){
                e.printStackTrace();
            }finally{
                Intent openStartingPoint = new Intent("com.splashscreen.MENU");

                startActivity(openStartingPoint);
            }
        }
    };

    timer.start();
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();

    ourSong.release();
    finish();
}

}

2 个答案:

答案 0 :(得分:0)

Splash.java

的变化
     Intent("com.splashscreen.MENU");

更改为

     Intent("com.splashscreen.Menu");

答案 1 :(得分:0)

在com.splashscreen包文件夹中创建一个活动菜单作为类名 例如

public class Menu extends Activity{ }

然后在定时器代码finally块中调用以下代码

Intent mIntent = new Intent(StartingPoint.this,com.splashscreen.Menu.class);
startActivity(mIntent);

这将解决您的问题。