Possible Duplicate:
Android: Toast in a thread
I'm trying to show a Toast inside a Thread using the standard method:
Toast.makeText(context, "Hello World!", Toast.LENGTH.SHORT).show();
In normal way, this is ofcourse working. But when I try to call from a separate thread I have an exception:
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
I have absolutely no clue of what it means.
The context value I pass is the Application itself (an Application inherits from a Context) or an Application.getApplicationContext()
.
By the way, I've also absolutely no idea why there is this redundant thing.
Application (which is by itself already a Context)
and Application.getApplicationContext()
.