码迷,mamicode.com
首页 > 其他好文 > 详细

13.toast简化

时间:2015-10-29 21:30:57      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:

代码中大量写toast,如果嫌麻烦,可以新建一个工具类
  1. public class ToastUtils {
  2. public static void showToast(Context ctx, String text) {
  3. Toast.makeText(ctx, text, Toast.LENGTH_SHORT).show();
  4. }
  5. }
  6. ToastUtils.showToast(this, "安全号码不能为空!");





13.toast简化

标签:

原文地址:http://www.cnblogs.com/liuyu0529/p/4921687.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!