Example usage for android.widget Toast makeText

List of usage examples for android.widget Toast makeText

Introduction

In this page you can find the example usage for android.widget Toast makeText.

Prototype

public static Toast makeText(Context context, @StringRes int resId, @Duration int duration)
        throws Resources.NotFoundException 

Source Link

Document

Make a standard toast that just contains a text view with the text from a resource.

Usage

From source file:Main.java

public static void showToast(Context context, String text) {
    if (null != text && !text.isEmpty())
        Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

private static void toast(Context context, String msg, int lenth) {
    Toast.makeText(context, msg, lenth).show();
}

From source file:Main.java

public static void showToast(Context context, String string) {
    Toast toast = Toast.makeText(context, string, Toast.LENGTH_SHORT);
    toast.setGravity(Gravity.CENTER, 0, 0);
    toast.show();/* ww  w .j  a  v a 2  s . co  m*/
}

From source file:Main.java

public static void toastMessage(Context context, String string) {
    // TODO Auto-generated method stub
    Toast.makeText(context, string, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void showRetrytMsg(final Context context, String msg) {
    Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
}

From source file:Main.java

public static void showToast(Context ctx, String message) {
    Toast tost = Toast.makeText(ctx, message, Toast.LENGTH_SHORT);
    tost.setGravity(Gravity.CENTER, 0, 0);
    tost.show();//from w w w  . j  av a 2s.  c  o m
}

From source file:Main.java

public static void Toast_make(Context context, String showcontent) {
    Toast.makeText(context, showcontent, Toast.LENGTH_LONG).show();
}

From source file:Main.java

public static void showToast(Context context, String message) {
    Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
    toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0);
    toast.show();/*  www.j  a va2 s.co m*/
}

From source file:Main.java

public static void showToast(String message, Context context) {
    Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
    toast.setGravity(Gravity.CENTER, 0, 0);
    toast.show();//w ww . j  a  v a 2  s  .  com
}

From source file:Main.java

public static void showLToast(Context context, String text) {
    Toast toast = Toast.makeText(context, text, Toast.LENGTH_LONG);
    toast.setGravity(Gravity.CENTER, 0, 0);
    toast.show();//from  w  ww . j a v  a 2  s  .c om
}