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.
final Handler mHandler = new Handler();
final Runnable mUpdateResults = new Runnable() {
public void run() {
Toast(this, message, duration).show();
}
new Thread() {
public void run() {
mHandler.post(mUpdateResults);
}
}.start();