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 alertMsg(Context context, int msg) {
    Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void makeToast(Context context, String text) {
    if (toast == null) {
        toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
    } else {//from   ww w  .ja v a2s .  c o m
        toast.setText(text);
    }
    toast.show();
}

From source file:Main.java

public static void popTipOrWarn(Context ctx, int txt) {
    Toast.makeText(ctx, txt, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void showSingleToast(Context context, String text) {
    if (sToast == null) {
        sToast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
    }/*from  w  w w .  ja  v a  2s. c o  m*/
    sToast.setText(text);
    sToast.show();
}

From source file:Main.java

public static void ToastMessage(Context cont, int msg) {
    Toast.makeText(cont, msg, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

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

From source file:Main.java

public static void showToast(Context context, int msgId) {
    Toast.makeText(context, msgId, Toast.LENGTH_LONG).show();
}

From source file:Main.java

public static void toastLong(Context context, int id) {
    Toast.makeText(context, id, Toast.LENGTH_LONG).show();
}

From source file:Main.java

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

From source file:Main.java

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