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 showMiddleToast(Context cxt, String msg) {
    Toast toast = Toast.makeText(cxt, msg, Toast.LENGTH_SHORT);
    toast.setGravity(Gravity.CENTER, 0, 0);
    toast.show();//from   w  w w.  j a v a 2s  .c o  m
}

From source file:Main.java

public static void showToast(Activity activity, String message) {
    if (activity != null) {
        Toast.makeText(activity, message, Toast.LENGTH_SHORT).show();
    }//from  w ww  .j a  va 2 s .c  o  m
}

From source file:Main.java

public static void makeToast(Activity currentActivity, String message) {
    Toast.makeText(currentActivity.getApplicationContext(), message, Toast.LENGTH_SHORT).show();

}

From source file:Main.java

public static void toast(Activity activity, String txt) {
    Toast toast = Toast.makeText(activity, txt, Toast.LENGTH_SHORT);
    int xoffset = 30, yoffset = 30;
    toast.setGravity(Gravity.RIGHT, xoffset, yoffset);
    toast.show();//from   w  w w . ja va2 s.c o m
}

From source file:Main.java

public static void toast(Context context, String msg) {
    if (context != null || msg != null) {
        Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
    }//from  w w  w.  j a va2  s . co  m
}

From source file:Main.java

public static void show(Context activity, String string) {
    Toast.makeText(activity, string, Toast.LENGTH_SHORT).show();

}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static void showToast(Context context, String msg) {

    Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

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