2011-05-18 33 views
0
<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
     package="com.androidgames" 
     android:versionCode="1" 
     android:versionName="1.0"> 
    <uses-sdk android:minSdkVersion="3" /> 

    <application android:icon="@drawable/icon" android:label="@string/app_name"> 
     <activity android:name=".AndroidBasicsStarter" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 

     //New Activity   
     <activty android:label="Life Cycle Test" 
        android:name=".LifeCycleTest" 
        android.configChanges="keyboard|keyboardHidden|orientation" /> 

    </application> 
</manifest> 
+0

除了你可能應該有一些意圖過濾器的事實,我認爲就是這樣。 – Alxandr 2011-05-18 02:03:13

+3

我也看到兩個拼寫錯誤......「」拼寫錯誤,它應該是「android:configChanges = ...」以防萬一,因爲無法運行它。 – 2011-05-18 02:06:06

+0

@Michael Herold - 謝謝! – kachilous 2011-05-18 02:09:39

回答

2

這看起來不錯,但考慮將標籤貼到字符串資源文件:

在這種情況下,您的活動應匹配的正確方法LifeCycleTest類在你的包的根目錄(com.androidgames)。

+0

太好了。我確實創建了一個名爲LifeCycleTest的類。但是,當我點擊android模擬器中的活動時,它說:「應用程序啓動器(process com.androidgames)意外停止,請再次嘗試」 – kachilous 2011-05-18 02:07:06

+0

發言太快。 @Michael Herold指出了一些錯誤。 – kachilous 2011-05-18 02:08:55

+0

確保新類有一個onCreate(),如果你還沒有。 – 2011-05-18 02:09:37

0

是的,這是關於它的總和。

相關問題