简体   繁体   English

Android示例应用未显示

[英]Android sample app not showing up

New Android developer here. 这里有新的Android开发者。 I'm following a tutorial at http://www.vogella.de/ . 我正在关注http://www.vogella.de/上的教程。 The first applications (does temperature conversion) works. 第一个应用程序(温度转换)工作。 The second (does preferences and uses a menu) one never shows up. 第二个(做首选项并使用菜单)永远不会出现。 I've tried using both Helios and Galileo. 我尝试过使用Helios和Galileo。 I've tried re-installing Android SDK. 我试过重新安装Android SDK。 I've tried removing the test device and re-creating it. 我已经尝试删除测试设备并重新创建它。 Others say this tutorial works. 其他人说这个教程有效。

When the other app works, it doesn't get the two lines "No Launcher activity found!" 当另一个应用程序工作时,它没有得到两行“找不到启动器活动!” and "The launch will only sync the application packages on the device." 和“启动只会同步设备上的应用程序包。”

What I see: 我所看到的:

------------------------------
...] 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: here is the text from my Android manifest file 更新:这是我的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>

Here's the answer, which I had to find elsewhere. 这是答案,我必须在其他地方找到。 It seems that you must have the following element: 看来你必须拥有以下元素:

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

inside your AndroidManifest.xml file. AndroidManifest.xml文件中。 Once I added this, then right-clicked on the project name to launch the Android Application, the app then showed up in the menu panel. 一旦我添加了这个,然后右键单击项目名称以启动Android应用程序,该应用程序随后出现在菜单面板中。

Eclipse put this ( intent-filter ) element there for my first experimental application, but it did not do me the favor for the second one I created, which I'm still debugging for yet other (and probably Eclipse-related) reasons. Eclipse将这个( intent-filter )元素放在那里作为我的第一个实验性应用程序,但它并没有让我对我创建的第二个元素有所帮助,我还在调试其他(可能与Eclipse相关)的原因。 (I probably filled something out wrong when creating the new Android project.) (在创建新的Android项目时,我可能填补了一些错误。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM