My application launches a thread to query the web for some data. I want to display a Toast message when nothing is found, but my application always crashes.
I've tried using the application Context from within the thread, like so:
Toast.makeText(getApplicationContext(), "testttt", Toast.LENGTH_LONG).show();
I've also tried creating a Runnable with the Toast call and calling runOnUiThread(runnable) from the Thread (the Toast call in this runnable uses the Activity as the first parameter).
Does anyone have any ideas on how to accomplish this?