【发布时间】:2014-02-23 18:56:30
【问题描述】:
我的程序有启动页面我使用意图将启动活动传递到我的主活动文件夹但是当我运行我的程序时它在启动后停止 这是我的启动类和清单 xml 以及我的 logcat
package com.tesbih;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class Splash extends 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{
sleep(5000);
}catch(InterruptedException e){
e .printStackTrace();
}finally{
Intent openStartingPoint = new Intent ("com.tesbih.TESBIHMAINACTIVITY");
startActivity(openStartingPoint);
}
}
};
timer.start();
}
}
并遵循我的清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tesbih"
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.tesbih.TesbihMainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.TESBIHMAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.tesbih.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>
</application>
</manifest>
这里是我的日志猫
02-23 20:33:40.713: E/AndroidRuntime(5683)android.content.ActivityNotFoundException: 找不到处理 Intent { act=com.tesbih.TESBIHMAINACTIVITY }
的活动
【问题讨论】:
-
您的清单中有活动吗?
-
在清单中标明 TESBIHMAINACTIVITY
标签: android xml android-intent splash-screen