Is it possible to use AsyncTask in a Service class ?
- by Spredzy
Everything is in the title.
On the official documentations it is stated that Note that services, like other application objects, run in the main thread of their hosting process and AsyncTask only works if it is executed in the UIThread.
So is it possible to use AsyncTask in a Service class?
I am trying to do so but I'm always getting the same error
05-01 18:09:25.487: ERROR/JavaBinder(270): java.lang.ExceptionInInitializerError
...
05-01 18:09:25.487: ERROR/JavaBinder(270): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
Am I doing something wrong or is this just impossible ?