Answers for "how to stop toast message from overlapping"

0

how to stop toast message from overlapping

final Toast tst = Toast.makeText(ctx, "This is a toast.", Toast.LENGTH_SHORT);
tst.show();

Handler handler = new Handler();
    handler.postDelayed(new Runnable() {
       @Override
       public void run() {
           tst.cancel(); 
           tst.setText("Same toast with another message.");
           tst.show();
       }
}, 1000);
Posted by: Guest on May-13-2020

Browse Popular Code Answers by Language