为什么我在控制台中看到错误但模拟器仍然运行我的项目?

时间:2012-01-30 09:28:57

标签: android emulation

我试图了解启动器是如何工作的,所以我要查看示例代码" Home"这包含在adroid sdk中。当我运行项目时,下面是我在控制台中看到的。由于模拟器似乎工作得很好,我想知道为什么我会看到" No Launcher活动被发现!"控制台出错?

[2012-01-30 11:24:18 - Home] ------------------------------
[2012-01-30 11:24:18 - Home] Android Launch!
[2012-01-30 11:24:18 - Home] adb is running normally.
[2012-01-30 11:24:18 - Home] **No Launcher activity found!**
[2012-01-30 11:24:18 - Home] **The launch will only sync the application package on the** device!
[2012-01-30 11:24:18 - Home] Performing sync
[2012-01-30 11:24:18 - Home] Automatic Target Mode: Preferred AVD 'AVDNew' is available on emulator 'emulator-5554'
[2012-01-30 11:24:18 - Home] WARNING: Application does not specify an API level requirement!
[2012-01-30 11:24:18 - Home] Device API version is 8 (Android 2.2)
[2012-01-30 11:24:18 - Home] Uploading Home.apk onto device 'emulator-5554'
[2012-01-30 11:24:19 - Home] Installing Home.apk...
[2012-01-30 11:24:29 - Home] Success!
[2012-01-30 11:24:29 - Home] \Home\bin\Home.apk installed on device
[2012-01-30 11:24:29 - Home] Done!

1 个答案:

答案 0 :(得分:1)

在AndroidManifest.xml中为您的活动设置以下意图过滤器

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