I wish to display a toast if a certain condition is true or false. However I want this toast to delay for two secon
toast
true
false
delay
two secon
Try this..
Use Handler
// Handler which will run after 2 seconds. new Handler().postDelayed(new Runnable() { @Override public void run() { Toast.makeText(MathsGameResults.this, "Data is successfully uploaded.", Toast.LENGTH_LONG).show(); } }, 2000);