这是第二个活动添加到我的manifest.xml文件
问题描述:
<?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>
答
这看起来不错,但考虑将标签贴到字符串资源文件:
在这种情况下,您的活动应匹配的正确方法LifeCycleTest类在你的包的根目录(com.androidgames)。
答
是的,这是关于它的总和。
除了你可能应该有一些意图过滤器的事实,我认为就是这样。 – Alxandr 2011-05-18 02:03:13
我也看到两个拼写错误......“”拼写错误,它应该是“android:configChanges = ...”以防万一,因为无法运行它。 –
2011-05-18 02:06:06
@Michael Herold - 谢谢! – kachilous 2011-05-18 02:09:39