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 ToastLong(String message, Context context) {
    // ApplicationHelper.ToastLong("", getApplicationContext());
    Toast.makeText(context, message, Toast.LENGTH_LONG).show();
}

From source file:Main.java

public static void showToast(Context context, String message) {
    if (null == context) {
        return;/*w  w  w . j  a v a 2 s .  c  o  m*/
    }
    Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

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

From source file:Main.java

public static void showToast(CharSequence message, Context context) {
    int duration = Toast.LENGTH_SHORT;

    Toast toast = Toast.makeText(context.getApplicationContext(), message, duration);
    toast.show();/* w ww  .j a v a2s.  c o m*/
}

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

/**
 * Displays the message as a Toast on the UI
 *///from  w ww.  j  a v  a 2  s. c o  m
public static void displayToast(Context context, String msg) {
    Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void initToast(Context context) {
    mToast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
}

From source file:Main.java

public static void displayToast(Context context, String message) {
    if (isToast) {
        Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
    }// w ww. ja v a2 s . c o  m
}

From source file:Main.java

public static void showToast(Context context, String content) {
    if (toast == null)
        toast = Toast.makeText(context, content, Toast.LENGTH_SHORT);
    else/*  w  w w  .j av a 2 s  .  c o m*/
        toast.setText(content);
    toast.show();
}

From source file:Main.java

public static void showToast(Context context, String str) {
    if (toast == null) {
        toast = Toast.makeText(context, str, Toast.LENGTH_SHORT);
    }/*  w ww.java  2  s  . com*/
    toast.setText(str);
    toast.show();
}