Actually, I have a service that runs in activity, and continues to work after its destruction. During the destruction of the activity, the service is restarted. If I understand correctly, to start the Service immediately outside the UI stream, you must declare in the manifest android:process="my.own.ProcessName" , but this does not work. What am I doing wrong? Or maybe use IntentService . Does it immediately start in a new thread?
|
2 answers
Just run IntentService - this is a special version of Service that runs in its thread (not in the UI) and does not bother anyone.
- Tell me what function will execute 'android: process'? from the docking process for multiple processes. I understand that this obliges the service to start in the new stream? - Bogdan Shulga
- Read here - Barmaley
- Guru), explain, plz ... I understand that in this case, the service is started in the nomov stream so as not to hang the UI but in the same process. When the activity is closed, the stream is destroyed along with the process. - Bogdan Shulga February
- In general, as it turned out in my case, start Foreground is best suited) - Bogdan Shulga
|
Thread t = new Thread(){ public void run(){ getApplicationContext().bindService( new Intent(getApplicationContext(), MyAndroidUpnpServiceImpl.class), serviceConnection, Context.BIND_AUTO_CREATE ); } }; t.start(); - Tell me what function will execute 'android: process'? - Bogdan Shulga February
|