2012-06-22 20 views
-3

我創建了一個小應用程序,當我在模擬器上運行它時,它運行完美。Android應用程序在模擬器上工作,並安裝在Android設備上,但當我打開它時,它顯示空白屏幕,然後強制關閉

但是,當我將其安裝在設備上並啓動它時,它顯示空白/黑屏,然後與消息The Application TOH(process my.own) has stopped unexpectedly崩潰。

不知道我在做什麼錯..

請指教..

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="my.own" 
android:versionCode="2" 
android:versionName="2.3.4" > 

<uses-sdk android:minSdkVersion="10" /> 
<supports-screens android:smallScreens="true" 
     android:normalScreens="true" 
     android:largeScreens="true" 
     android:xlargeScreens="true" 
     android:anyDensity="true" /> 
<application 
    android:icon="@drawable/background2" 
    android:label="@string/app_name" > 

    <activity 
     android:name=".TOH" 
     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=".Startgame" 
     android:label="@string/app_name"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      </intent-filter> 
    </activity> 

    <activity 
     android:name=".scoretell" 
     android:label="@string/app_name"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

     </intent-filter> 
    </activity> 
    <activity android:name=".details" 
     android:label="@string/app_name"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

     </intent-filter> 
    </activity> 
    <activity 
     android:name=".ShowPopUp" 
     android:label="@string/app_name"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      </intent-filter> 
    </activity> 

</application> 

</manifest> 
+1

如果您在這裏發佈LogCat,這將會很有幫助。 – DrA

+0

這是因爲你的代碼中有錯誤。 ... – Selvin

+0

您的'supports-screens'標籤完全是多餘的......默認情況下,這些值被設置爲「true」。你應該刪除它。 –

回答

0

看看當你運行你的應用程序模擬器什麼logcat的說。

它在我之前發生過,當應用程序在仿真器上運行時,出現了一些「非致命」錯誤(在Logcat中以橙色標記),但顯然該錯誤在應用程序部署在真實設備上時是致命的,因爲它崩潰。

0

嘗試從activitys刪除以下代碼:

<intent-filter> 
    <action android:name="android.intent.action.MAIN" /> 
</intent-filter> 
0

像其他人說,Android清單(或與此有關的任何XML文件)不會告訴你錯誤的故事。該文件中有一些問題需要解決,但這可能會或可能不會導致錯誤。 LogCat在Eclipse中說什麼?這可以在Eclipse中作爲窗格訪問:窗口>顯示視圖> LogCat。如果您使用連接到設備的USB進行調試,它可能會出現(紅色)錯誤/文本。這將有助於社區看到具體的錯誤,甚至可能會指向您的代碼行進不便的行號。僅供參考,this是logcat屏幕的外觀。

相關問題