public class ToastUtil {
private static Toast mToast;
public static void showToast(Context context,String str){
if(mToast==null){
mToast=new Toast(context);
View view=mToast.makeText(context,"",Toast.LENGTH_SHORT).getView();
mToast.setView(view);
mToast.setText(str);
mToast.setDuration(Toast.LENGTH_SHORT);
mToast.show();
}else{
mToast.setText(str);
mToast.show();
}
}
}