I am trying to post a toast after calling a function from a non UI thread in a widget. I\'ve read multiple ways of doing this (post/new handler/broadcast) but most methods s
if(Looper.myLooper() == null) {
Looper.getMainLooper();
}
Looper.prepare();
new Handler().post(new Runnable() {
@Override
public void run() {
Toast.makeText(LargeAppWidget.this.context, "Sample Text", Toast.LENGTH_SHORT).show();
}
});
Looper.loop();
It is not recommended to use looper.