multithreading - Process and threads in android -
can service , activity run in same linux process @ same time.?
private class test extends service{ @override public int onstartcommand(intent intent, int flags, int startid) { new thread(new runnable() { @override public void run() { // computational logic } }).start(); return super.onstartcommand(intent, flags, startid); } @override public ibinder onbind(intent intent) { // todo auto-generated method stub return null; } }
does the thread execute in new linux process or same process call service(ui process)?.
by default every application runs in own process , components of application run in process.
can service , activity run in same linux process @ same time.?
the above statement answer question, , here's services docs 1 more time says:
the service object not imply running in own process; unless otherwise specified, runs in same process application part of.
for further reading consider link: http://developer.android.com/guide/components/processes-and-threads.html
Comments
Post a Comment