在一个单独的进程启动的Android服务 [英] Start a service in a separate process android
问题描述
我想在一个单独的进程来启动服务(即当我去我的程序管理中的设置,然后去运行的服务,它应该显示我在一个单独的进程服务)。
I want to start a service in a separate process (i.e when I go to my Application manager in the settings and then go to running services, it should show my service in a separate process).
我的Android清单如下:
My Android Manifest is as follows:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.timerapp.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.example.timerapp.WorkerThread"
android:process="com.moizali"></service>
</application>
我开始在我的MainActivity服务如此明显,当我杀了服务关闭,以及应用程序。谁能告诉我如何启动服务作为一个不同的进程。
I am starting the service in my MainActivity so obviously when I kill the application the service shuts down as well. Can anyone tell me how to start the service as a different process.
推荐答案
有一个在这个<一个href=\"http://mindtherobot.com/blog/37/android-architecture-tutorial-developing-an-app-with-a-background-service-using-ipc/\" rel=\"nofollow\">http://mindtherobot.com/blog/37/android-architecture-tutorial-developing-an-app-with-a-background-service-using-ipc/
这里的一切对您的查询解释!
Here everything is explained regarding your query!
这篇关于在一个单独的进程启动的Android服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!