我有一個應用程序,其目的只是作爲服務運行(沒有界面,只是在後臺運行)。我的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