So, from what I know, if I do AsyncTaskinside Activity, the task can be killed when the user completes the work Activitybefore it is completed. One solution I've seen is to use IntentServicewhich the system will try not to kill.
My problem is that it IntentServiceuses only one background thread to complete all the tasks one by one. I have several independent tasks that I want to run at the same time, and that matters in the user interface (it doesn't matter, but it may surprise the user).
How to do it? I guess I may have several IntentService, but this seems uncomfortable and not scalable. How to keep a stream view that has a good priority so that it will not be easily destroyed by the system?
If I run (normal) Serviceand then run there AsyncTask, will this lead to a higher priority?
Many thanks.
source
share