Thursday, 2 July 2015

android how to make toast display time shorter





final Toast toast = Toast.makeText(getApplicationContext(), "message", Toast.LENGTH_SHORT);
    toast.show();

    Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
           @Override
           public void run() {
               toast.cancel(); 
           }
    }, 500);

No comments:

Post a comment