这里是新的 Android 开发人员。我正在关注以下教程http://www.vogella.de/。第一个应用程序(进行温度转换)有效。第二个(执行首选项并使用菜单)永远不会出现。我尝试过使用 Helios 和 Galileo。我尝试过重新安装Android SDK。我尝试删除测试设备并重新创建它。其他人说这个教程有效。
当其他应用程序运行时,它不会出现两行“未找到启动器活动!”和“启动将仅同步设备上的应用程序包。”
我所看到的:
------------------------------
...] Android Launch!
...] adb is running normally.
...] No Launcher activity found!
...] The launch will only sync the application package on the device!
...] Performing sync
...] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'TestDevice'
...] Uploading de.vogella.android.preferences.apk onto device 'emulator-5554'
...] Installing de.vogella.android.preferences.apk...
...] Success!
...] \de.vogella.android.preferences\bin\de.vogella.android.preferences.apk installed on device
...] Done!
UPDATE:这是我的 Android 清单文件中的文本
<manifest
xmlns:android="schemas.android.com/apk/res/android";
package="de.vogella.android.preferences"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloPreferences" android:label="@string/app_name">
</activity>
<activity android:label="Preferences" android:name="Preferences">
</activity>
</application>
<uses-sdk android:minSdkVersion="8" />
</manifest>
这是我必须在其他地方找到的答案。看来你必须有以下元素:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
在你的里面AndroidManifest.xml文件。添加此内容后,右键单击项目名称以启动 Android 应用程序,该应用程序就会显示在菜单面板中。
Eclipse 把这个(意图过滤器) 元素存在于我的第一个实验应用程序中,但它并没有给我创建的第二个应用程序带来好处,我仍在调试它,因为还有其他(可能与 Eclipse 相关的)原因。 (我可能在创建新的Android项目时填写了错误的内容。)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)