Example usage for android.widget Toast show

List of usage examples for android.widget Toast show

Introduction

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

Prototype

public void show() 

Source Link

Document

Show the view for the specified duration.

Usage

From source file:Main.java

public static void showError(String msg, Context context) {
    CharSequence text = msg;/*w w  w  .j av  a  2 s .co  m*/
    int duration = Toast.LENGTH_SHORT;

    Toast toast = Toast.makeText(context, text, duration);
    toast.show();
    return;
}

From source file:Main.java

/**
 * Method to generate a toast.//  ww w .  j a v a  2 s . com
 * @param context The target context
 * @param content The toast content
 * @param duration The toast duration
 */
public static void toastContext(final Context context, final String content, final int duration) {
    Toast toast = Toast.makeText(context, content, duration);
    toast.show();
}

From source file:Main.java

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

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 toastShort(Activity activity, String message) {
    Toast toast = Toast.makeText(activity, message, Toast.LENGTH_SHORT);
    toast.show();
}

From source file:Main.java

/**
 * Show a toaster witht message/*from w  w w .j a  v a2s  .  c om*/
 * @param con
 * @param message
 */
public static void showToaster(Context con, String message) {
    Toast toast = Toast.makeText(con, message, Toast.LENGTH_LONG);
    toast.show();
}

From source file:Main.java

/**
 * Shows a toast message within the context, showing the message for a
 * certain duration/*from w ww .ja v a  2s  . co m*/
 * 
 * @param context
 * @param message
 * @param duration
 */
public static void showToastMessage(Context context, int message, int duration) {
    Toast toast = Toast.makeText(context, message, duration);
    toast.show();
}

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 showToast(Context context, CharSequence message) {
    Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
    toast.show();
}

From source file:Main.java

public static void showToastLong(String message) {
    Toast toast = Toast.makeText(context, message, Toast.LENGTH_LONG);
    toast.show();
}