Question: I am using toast on android, However I dont want the toast to disappear. but rather stay...
And I dont want the toast to show up on different activity or fragment.
If I called toast in certain fragment, i dont want it to be seen in a different fragment or activity.
Lets say activity 1, i call toast..i go to activity 2... i dont want toast to be displayed yet. when i return to activity 1 i see the toast still in place.
I also want this for fragments.

> 
> Toast toast = Toast.makeText(dialog.getContext(),R.string.serverError, Toast.LENGTH\_LONG);
>  toast.show();
> 
> 
>

Answer: 
If you want that Toast should not remain on the screen when you move out of Activity then I would suggest you to use third party library [Crouton](https://github.com/keyboardsurfer/Crouton)
Use below code in your activity `onDestory` method:

```
toast.cancel();

```