2011-07-10 27 views
0

我有一個Android應用程序,我試圖通過教程發現啓動畫面,我發現並添加了一個額外的活動清單「SplashScreen」,但我的其他活動仍然首先加載。如果我拿出另一個,啓動屏幕將加載但崩潰。我怎樣才能讓SplashScreen先加載?Android錯誤的動作加載

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
     package="projectmp.android" 
     android:versionCode="1" 
     android:versionName="1.0"> 
    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true"> 
     <uses-library android:name="com.google.android.maps" /> 
     <activity android:name=".SplashScreen" 
        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=".MissionPlanner" 
        android:label="@string/app_name" 
        android:theme="@android:style/Theme.NoTitleBar"> 
      <intent-filter> 
       <action android:name="projectmp.android.MissionPlanner" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
    </application> 

    <uses-sdk android:minSdkVersion="7" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 
</manifest> 

感謝

+0

從MissionPlanner聲明中刪除意圖過濾器,這不是必需的。一旦你做完了,SplashScreen崩潰就會看到你的LogCat輸出中的錯誤。 – Blundell

+0

我以前試過,它不工作,這是錯誤: '[2011-07-10 07:17:32 - ProjectMP] ActivityManager:啓動:Intent {act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] cmp = projectmp.android/.MissionPlanner} [2011-07-10 07:17:32 - ProjectMP] ActivityManager:java.lang.SecurityException:Permission Denial:starting Intent {act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] flg = 0x10000000 cmp = projectmp.android/.MissionPlanner} from null(pid = -1,uid = -1)require null ' – PolishHurricane

回答

0

無論你是從仍然啓動它認爲它正在嘗試啓動MissionPlanner。它可能會緩存應用程序的早期定義。默認的主屏幕啓動器不應該有這種效果,但第三方或主屏幕快捷方式將會。

+0

' m使用eclipse,一切都是默認的,我不斷清理我的項目。我在意向過濾器下嘗試了多個操作和類別。什麼都沒有 – PolishHurricane

+0

@Mike:這個問題可能與您在Eclipse中的運行配置有關。 – CommonsWare

+0

沒錯,謝謝。 – PolishHurricane