$Android Toast封装

 1 /**
 2  * Android Toast封装
 3  */
 4 
 5 import android.content.Context;
 6 import android.widget.Toast;
 7 
 8 public class ToastUtil {
 9 
10     // 短时间显示Toast信息
11     public static void showShort(Context context, String info) {
12         Toast.makeText(context, info, Toast.LENGTH_SHORT).show();
13     }
14 
15     // 长时间显示Toast信息
16     public static void showLong(Context context, String info) {
17         Toast.makeText(context, info, Toast.LENGTH_LONG).show();
18     }
19 
20 }
原文地址:https://www.cnblogs.com/jiayongji/p/5314990.html