尝试从Eclipse Juno中加载示例My First App(hello world)应用程序。 Eclipse显示我的设备在线。手机正在运行Kit Kat 4.4.2。开发者模式已开启。 USB调试已启用。
以下是控制台输出:
[2014-07-02 03:32:15 - MyFirstApp] Android Launch!
[2014-07-02 03:32:15 - MyFirstApp] adb is running normally.
[2014-07-02 03:32:15 - MyFirstApp] No Launcher activity found!
[2014-07-02 03:32:15 - MyFirstApp] The launch will only sync the application package on the device!
[2014-07-02 03:32:15 - MyFirstApp] Performing sync
[2014-07-02 03:32:15 - MyFirstApp] Uploading MyFirstApp.apk onto device 'bc176a2b'
[2014-07-02 03:32:16 - MyFirstApp] Installing MyFirstApp.apk...
[2014-07-02 03:32:21 - MyFirstApp] Success!
[2014-07-02 03:32:21 - MyFirstApp] \MyFirstApp\bin\MyFirstApp.apk installed on device
[2014-07-02 03:32:21 - MyFirstApp] Done!
Absolutely nothing from the hello world app shows up on the phone. It just continues to display the home screen.
When I try to use Eclipse's AVD to run the app, I get the following Console output:
[2014-07-02 03:34:48 - MyFirstApp] ------------------------------
[2014-07-02 03:34:48 - MyFirstApp] Android Launch!
[2014-07-02 03:34:48 - MyFirstApp] adb is running normally.
[2014-07-02 03:34:48 - MyFirstApp] No Launcher activity found!
[2014-07-02 03:34:48 - MyFirstApp] The launch will only sync the application package on the device!
[2014-07-02 03:34:48 - MyFirstApp] Performing sync
[2014-07-02 03:34:49 - MyFirstApp] Application already deployed. No need to reinstall.
[2014-07-02 03:34:49 - MyFirstApp] \MyFirstApp\bin\MyFirstApp.apk installed on device
[2014-07-02 03:34:49 - MyFirstApp] Done!
当模拟器对话框(屏幕)加载时,应用程序没有加载。因此,模拟器对话框保留在其主屏幕上。
请告知。
这是AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</application>
</manifest>
答案 0 :(得分:3)
在android manifest中使用它
<activity
android:name="youractivityname"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>