7

Toast coming Multiple Times

view full story
linux-howto

http://stackoverflow.com – In my application , on a button click I am creating a Toast as - Toast.makeText(context,"Please Enter Username",Toast.LENGTH_SHORT).show(); But when someone clicks on the button 5-6 times and closes the application, or goes on another screen, it still keeps on showing the Toast for sometime on another screen also. I have seen many solutions for the same. I have tried - toast = Toast.makeText(LoginActivity.this, message, Toast.LENGTH_SHORT); toast.show(); and have cancelled this toast- onPause(){ if(toast!=null){ toast.cancel(); } and same on onDestroy() Please help me ho (HowTos)