gpt4 book ai didi

android-emulator - Android 示例应用未显示

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:37:41 26 4
gpt4 key购买 nike

这里是新的 Android 开发者。我正在学习 http://www.vogella.de/ 上的教程.第一个应用程序(进行温度转换)有效。第二个(执行首选项并使用菜单)永远不会出现。我试过同时使用 Helios 和 Galileo。我试过重新安装 Android SDK。我试过删除测试设备并重新创建它。其他人说本教程有效。

当其他应用程序运行时,它不会收到两行“未找到启动器 Activity !”和“启动只会同步设备上的应用程序包。”

我看到的:

------------------------------
...] 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!

更新:这是我的 Android list 文件中的文本

<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 将这个 (intent-filter) 元素放在那里用于我的第一个实验性应用程序,但它对我创建的第二个应用程序没有帮助,我仍在为其他应用程序调试(可能与 Eclipse 相关的)原因。 (可能是我在新建Android项目的时候填错了。)

关于android-emulator - Android 示例应用未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3347569/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com