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 ctx, String s) {
    Toast.makeText(ctx, s, Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void showToast(Context theContext, String theMessage) {
    Toast toast = Toast.makeText(theContext, theMessage, Toast.LENGTH_SHORT);
    toast.show();
}

From source file:Main.java

public static void showToastBottom(Context context, String s) {
    Toast toast = Toast.makeText(context, s, 0);
    toast.setGravity(81, 0, 80);
    toast.show();
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static void showToastLong(String msg, Context ctx) {
    try {//  w w w. j av a2s.c om
        Toast.makeText(ctx, msg, Toast.LENGTH_LONG).show();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Main.java

public static void showToastMessage(Context context, String message, int time) {
    Toast.makeText(context, message, time).show();
}

From source file:Main.java

public static void showToastShort(String msg, Context ctx) {
    try {//from   w  w  w  .  java  2 s  .  com
        Toast.makeText(ctx, msg, Toast.LENGTH_SHORT).show();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

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

private static void showToast(int messageId) {
    Toast.makeText(mContext, messageId, Toast.LENGTH_SHORT).show();
}