控制活动Toast刷新
适用于 每次需要弹出吐司是 将原有吐司清楚,替换为新的吐司
public void showToast(String toastString) {
// 如果当前页没有吐司
if (toast == null) {
toast = Toast.makeText(getApplicationContext(), toastString, Toast.LENGTH_SHORT);
} else {
//关闭吐司显示
toast.cancel();
toast = Toast.makeText(getApplicationContext(), toastString, Toast.LENGTH_SHORT);
}
//显示吐司
toast.show();
}