Kill android toast?
问题 I have a button and on button click toast appears, if the user clicks on button several times and go to previous activity or even close the aplication toast is still visible, How to finish or cancel the toast when user goes to any other activity or how to prevent generation of toast? Toast.makeText(getApplicationContext(), "Enter correct goal!", Toast.LENGTH_SHORT).show() 回答1: try this cancel() Toast by using handler Toast toast = Toast.makeText(getApplicationContext(), "Test", Toast.LENGTH