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 showToast(String str) {
    Toast.makeText(contexts, str, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void notifyNoConnection(Context context) {
    Toast.makeText(context, "No internet connection", Toast.LENGTH_SHORT).show();
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static void showToast(Context context, String msg) {
    Toast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
    //toast.setGravity(Gravity.TOP|Gravity.LEFT, 0, 10);
    toast.show();/*from   w  w  w  . j  a  va2 s .  c  om*/
}

From source file:Main.java

public static Toast getPublicToast(String string, Context context) {
    return Toast.makeText(context, string, Toast.LENGTH_SHORT);
}

From source file:Main.java

public static void showNoImplementText(Context context) {
    Toast.makeText(context, "Add more codes to support!", Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void showToastShort(String msg, Context ctx) {
    try {/*w ww .j a  va 2  s . c  o  m*/
        Toast.makeText(ctx, msg, Toast.LENGTH_SHORT).show();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Main.java

public static void toastShort(Activity activity, String message) {
    Toast toast = Toast.makeText(activity, message, Toast.LENGTH_SHORT);
    toast.show();
}