当前位置: 移动技术网 > IT编程>移动开发>Android > android开发教程之实现toast工具类

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

2019年07月24日  | 移动技术网IT编程  | 我要评论

儿女传奇边城生死恋,朴灿烈我们结婚了,定西孤儿院纪事txt

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();

 }

}

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网