I have a method in my service witch must be called from within a thread but I don’t want that code to execute in the thread.
How can I call runOnUiThread if I have no activity and I am calling it from a service?
Thanks.
I am not interested in AsyncTask solution!
Maybe a
Handlercan help you. Handler is an element associated to the thread where is created, you can post a runnable with your code to the Handler and that runnable will be executed in the thread where the Handler was created.Information link:
http://developer.android.com/reference/android/os/Handler.html