首页 > 系统 > Android > 正文

android开发教程之实现toast工具类

2019-10-24 20:36:58
字体:
来源:转载
供稿:网友
这篇文章主要介绍了android开发中需要的toast工具类,需要的朋友可以参考下
 

Android中不用再每次都写烦人的Toast了,直接调用这个封装好的类,就可以使用了!

 

复制代码代码如下:

package com.zhanggeng.contact.tools;

 

/**
 * Toasttool can make you  use Toast more easy ; 
 * 
 * @author ZHANGGeng
 * @version v1.0.1
 * @since JDK5.0
 *
 */
import android.content.Context;
import android.widget.Toast;

public class Toasttool {

 /**
  * 
  * @param context  The Class's context , where  want to use this tool  
  * @param message  The message will be show
  */
 public static void MyToast(Context context ,String message){
  Toast.makeText(context, message, Toast.LENGTH_SHORT).show();

 }

}


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表