The android development tutorial implements the toast tool class

  • 2020-05-30 21:02:23
  • OfStack

Instead of writing the annoying Toast every time, just call the encapsulated class and use it!


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

 }
}


Related articles: