I have toast in method showText(); This method shows toast when we call that method. In second Activity I have a button and when I click on the button my Toast must be shows. Everything work great but when I click two or mnore times my toast will be showing long time. I want to toast show only when I click on button and when I click again, first toast disapear and shows again.
public void showText(String msg) {
Toast.makeText(this, msg, 1000).show();
}
How I can do this?
Instead of calling show(), you can keep a reference to the Toast you just created
http://developer.android.com/reference/android/widget/Toast.html