代码之家  ›  专栏  ›  技术社区  ›  Russ Bateman Basil Bourque

Android示例应用未出现

  •  4
  • Russ Bateman Basil Bourque  · 技术社区  · 14 年前

    新安卓开发者来了。我在听一个关于 http://www.vogella.de/

    当另一个应用程序工作时,它不会得到两行“找不到启动程序活动!”和“启动将只同步设备上的应用程序包。”

    我看到的是:

    ------------------------------
    ...] 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清单文件中的文本

    <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>
    
    1 回复  |  直到 12 年前
        1
  •  17
  •   Russ Bateman Basil Bourque    14 年前

    这是答案,我必须在别处找到。似乎你必须具备以下要素:

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

    AndroidManifest.xml文件

    日蚀把这个( 意向过滤器 )元素,但它并没有对我创建的第二个应用程序有利,我仍在调试这个应用程序,原因可能与Eclipse有关(在创建新的Android项目时,我可能填错了东西。)