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 toast(Context mcontext, String toastStr, int i) {
    Toast toast = Toast.makeText(mcontext, toastStr, Toast.LENGTH_SHORT);
    toast.setGravity(i, 0, 0);//Gravity.CENTER
    toast.show();/*from ww  w . ja  va 2s .  c om*/
}

From source file:Main.java

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

From source file:Main.java

public static void toast(Activity activity, final String msg) {
    Toast.makeText(activity, msg, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void showToast(Context ctxt, String message) {
    if (ctxt != null)
        Toast.makeText(ctxt, message, Toast.LENGTH_LONG).show();
}

From source file:Main.java

public static void showMessage(Context context) {
    Toast.makeText(context, "toast from payment library again", Toast.LENGTH_SHORT).show();
}

From source file:Main.java

/** show toast message */
public static void showToastMsg(Context ctx, String msg) {

    Toast.makeText(ctx, msg, Toast.LENGTH_SHORT).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();/*ww  w  .  j a  v a2s .  c  om*/
}

From source file:Main.java

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

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   w ww  .j  av  a2s.c o  m*/
}

From source file:Main.java

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