我開始開發,我試着在Youtube上跟着set of tutorials。嘗試按照教程1.8後,我非常困惑。「沒有找到處理意圖的活動」錯誤
發生什麼事是我啓動應用程序(使用模擬器),然後它打開應用程序。然後進入splash.xml屏幕,這只是一個背景,持續五秒鐘。然後,它假設回到MainActivity.java屏幕,這是主屏幕。不幸的是,在顯示啓動屏幕五秒之後,它告訴我應用程序已停止。
的AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.eduardopelaez.minecraftforums"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
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>
splash.xml(其被示出5秒打開應用後):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/minecraft_wallpaperrepeating"
android:orientation="vertical" >
</LinearLayout>
MainActivity.java(其被假定splash.xml後來,但是這是它崩潰):
package com.eduardopelaez.minecraftforums;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle TravisIsAwesome) {
super.onCreate(TravisIsAwesome);
setContentView(R.layout.splash);
Thread logoTimer = new Thread() {
public void run() {
try {
sleep(5000);
Intent menuIntent = new Intent(
"com.eduardopelaez.minecraftforums.MAINACTIVITY");
startActivity(menuIntent);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally {
finish();
}
}
};
logoTimer.start();
}
@Override
public boolean onCreateOptionsMenu(android.view.Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
它看起來像你試圖重新啓動您的MainActivity。 意圖代碼也是錯誤的,通常它看起來像: 新的意圖(this,ActivityToStart.class); //當這個,是當前活動 – 2013-05-03 02:29:19