Monday, July 25, 2016

Sending a Toast from a Service

Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() { @Override public void run()
{
    Toast.makeText(getApplicationContext(), "Detection Service Failed, restart it", Toast.LENGTH_LONG).show();
}
});

No comments:

Post a Comment