I am getting an Runtime Exception:Can't create handler inside thread that has not called Looper.prepare() while displaying the Toast message
in a worker thread.
I have a service (runs in a remote process) which creates an object. This object is responsible for connecting to a server in a thread. I get the response from the sever. I want to display the message from the server in the toast. At that time I getting this exception. I tried posting it in a Handler by using handler.post. But still i am getting the exception.
What should be the approach to avoid this.