我有一个应用程序,其目的只是作为服务运行(没有界面,只是在后台运行)。我的AndroidManifest.xml中没有提到任何活动,但是在电话启动时放置了一个接收器来启动应用程序。开始android应用程序没有活动
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<service
android:enabled="true"
android:name=".MyAppService">
<intent-filter>
<action
android:name = "me.myapp.MyAppService">
</action>
</intent-filter>
</service>
<receiver
android:enabled="true"
android:name=".BootReceiver">
<intent-filter>
<action android:name = "android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
</application>
问题是,当我开发(使用Eclipse)应用程序时,我需要经常测试我的更改。当我运行应用程序(用我的手机连接在调试模式下),我有一个像
[2011-12-14 00:18:40 - MyApp] Android Launch!
[2011-12-14 00:18:40 - MyApp] adb is running normally.
[2011-12-14 00:18:40 - MyApp] No Launcher activity found!
[2011-12-14 00:18:40 - MyApp] The launch will only sync the application package on the device!
[2011-12-14 00:18:40 - MyApp] Performing sync
消息我如何开始在运行该应用程序,而无需每次都重新启动吗?
编辑这是不可能的了适用于Android 3.1或以上。 Source
容易和工作,感谢 – 2011-12-14 00:40:32
如何将应用程序的行为在运行时?什么会使应用程序运行?开机后运行并不够好,因为Android可能会终止进程。什么会再次启动它? – 2013-06-16 17:47:39