Example usage for android.widget Toast show

List of usage examples for android.widget Toast show

Introduction

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

Prototype

public void show() 

Source Link

Document

Show the view for the specified duration.

Usage

From source file:Main.java

public static void showToastShort(String message) {
    Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
    toast.show();
}

From source file:Main.java

public static void showToast(Context theContext, String theMessage) {
    Toast toast = Toast.makeText(theContext, theMessage, Toast.LENGTH_SHORT);
    toast.show();
}

From source file:Main.java

public static void gerarToast(CharSequence message, Context applicarionContext) {
    int duration = Toast.LENGTH_LONG;
    Toast toast = Toast.makeText(applicarionContext, message, duration);
    toast.show();
}

From source file:Main.java

public static Toast showToast(Context context, String textMessage, int timeDuration) {
    if (null == context) {
        return null;
    }//from   w ww .  java 2 s.  com
    textMessage = (null == textMessage ? "Oops! " : textMessage.trim());
    Toast t = Toast.makeText(context, textMessage, timeDuration);
    t.show();
    return t;
}

From source file:Main.java

public static void Toast(Context context, String text, int length) {
    Toast toast = Toast.makeText(context, text, length);
    toast.show();
}

From source file:Main.java

public static void printError(Activity ctx, String message) {

    if (ctx != null && message != null) {
        Toast toast = Toast.makeText(ctx, message, Toast.LENGTH_LONG);
        toast.show();
    }//from  w  w  w . j  a  va 2  s .c  om

}

From source file:Main.java

public static void showToastUseStringFile(Context theContext, int theStringValue) {
    Toast toast = Toast.makeText(theContext, theStringValue, Toast.LENGTH_SHORT);
    toast.show();
}

From source file:Main.java

public static void showToastlong(Context applicationContext, String string) {
    Toast toast = Toast.makeText(applicationContext, string, Toast.LENGTH_LONG);
    toast.show();
}

From source file:Main.java

@NonNull
private static Toast show(@NonNull Context context, CharSequence text, int duration) {
    Toast toast = Toast.makeText(context, text, duration);
    toast.show();
    return toast;
}

From source file:Main.java

public static void Toast(Context context, int resourceID, int length) {
    Toast toast = Toast.makeText(context, resourceID, length);
    toast.show();
}