簡體   English   中英

Android示例應用未顯示

[英]Android sample app not showing up

這里有新的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!

更新:這是我的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將這個( intent-filter )元素放在那里作為我的第一個實驗性應用程序,但它並沒有讓我對我創建的第二個元素有所幫助,我還在調試其他(可能與Eclipse相關)的原因。 (在創建新的Android項目時,我可能填補了一些錯誤。)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM