Is there any benefit to put a broadcastreceiver in a separate process?
I 开发者_如何学Gosaw a piece of code, where the broadcastreceiver is declared in a separate process (android:process=":XXXXXX" in AndroidManifest.xml)
And the corresponding onReceive() code looks like this:
startService(new Intent(context, XXXService.class);
Process.killProcess(Process.myPid());
Is there any benefit to do this?
Is there any benefit to do this?
None that I can think of. That code in question should not even work, as AFAIK startService()
will not have begun by the time the process is killed.
精彩评论