Example usage for android.widget Toast LENGTH_SHORT

List of usage examples for android.widget Toast LENGTH_SHORT

Introduction

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

Prototype

int LENGTH_SHORT

To view the source code for android.widget Toast LENGTH_SHORT.

Click Source Link

Document

Show the view or text notification for a short period of time.

Usage

From source file:Main.java

public static void showCenterShortToast(String text, Context ctx) {

    int duration = Toast.LENGTH_SHORT;

    Toast toast = Toast.makeText(ctx, text, duration);

    toast.setGravity(Gravity.CENTER, 0, 0);

    toast.show();/*ww w . ja  va2s  .  c o  m*/

}

From source file:Main.java

public static void toast(String msg, Context ctx, Boolean isShort) {
    if (isShort) {
        Toast.makeText(ctx, msg, Toast.LENGTH_SHORT).show();
    } else {//from ww w. ja v  a 2s . com
        Toast.makeText(ctx, msg, Toast.LENGTH_LONG).show();
    }
}

From source file:Main.java

public static void toastShort(Context context, int text) {
    Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void showShortToast(Context context, String msg) {
    showToast(context, msg, Toast.LENGTH_SHORT);
}

From source file:Main.java

public static void showToast(Context con, String showMsg, boolean isLong) {
    Toast.makeText(con, showMsg, isLong ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void toast(Context context, int message) {
    Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void toastS(Context context, String msg) {
    toast(context, msg, Toast.LENGTH_SHORT);
}

From source file:Main.java

public static Toast toast(String msg) {
    Toast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
    toast.show();
    return toast;
}

From source file:Main.java

public static void showToast(Context context, String str) {
    Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void makeToast(Context context, String msg) {
    Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
}