我收到一个找不到活动的异常。我开始一个SplashScreen活动,然后将控件传递给MainActivity。未找到Android活动错误?
这里是我的清单文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="se.copernicus.activity"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="5" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/icon"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".SplashScreenActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="se.copernicus.activity.MainActivity" >
</activity>
<activity
android:label="@string/second_activity"
android:name="se.copernicus.activity.Secondactivity"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
</application>
</manifest>
这是我开始在第一个启动画面活动。
public class SplashScreenActivity extends Activity {
protected boolean _active = true;
protected int _splashTime = 5000;
Intent intent = new Intent("se.copernicus.activity.MainActivity");
Thread splashTread = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
splashTread = new Thread() {
@Override
public void run() {
try {
int waited = 0;
Log.i("Coming here 1","Coming here 1");
while(_active && (waited < _splashTime)) {
sleep(50);
Log.i("Coming here 2","Coming here 2");
if(_active) {
waited += 50;
Log.i("Coming here 3","Coming here 3");
}
}
} catch(InterruptedException e) {
// do nothing
} finally {
finish();
Log.i("Coming here 4","Coming here 4");
startActivity(intent);
Log.i("Coming here 5","Coming here 5");
if(splashTread!= null){
splashTread.stop();
splashTread=null;
}
}
}
};
splashTread.start();
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
_active = false;
}
return true;
}
}
我已经声明进行错误检查清单中的双重活性,包名了。然而,这个错误显示出来。我在哪里犯错误?
错误日志:在menifest应用标签
E/AndroidRuntime(340): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=se.copernicus.activity.MainActivity }
E/AndroidRuntime(340): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
E/AndroidRuntime(340): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
E/AndroidRuntime(340): at android.app.Activity.startActivityForResult(Activity.java:2827)
E/AndroidRuntime(340): at android.app.Activity.startActivity(Activity.java:2933)
E/AndroidRuntime(340): at se.copernicus.activity.SplashScreenActivity$1.run(SplashScreenActivity.java:41)
PLZ提供您的错误日志... – Ratan
@Vinoth:还满清单文件。 –
嗨kool4u,Adil Soomro。我刚刚添加了错误日志 – Vinoth