List of usage examples for android.widget Toast show
public void show()
From source file:Main.java
public static void showLToast(Context context, String text) { Toast toast = Toast.makeText(context, text, Toast.LENGTH_LONG); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); }
From source file:Main.java
public static void showHint(final Context c, String hintText, boolean makeItAQuickOne) { int duration = makeItAQuickOne ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG; Toast t = Toast.makeText(c, hintText, duration); t.setGravity(Gravity.CENTER_VERTICAL, 0, 0); t.show(); }
From source file:Main.java
public static void ShowToastCenter(Context context, String strText, int nTime) { if (context != null) { Toast toast = Toast.makeText(context, strText, nTime); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); }/* w ww . j a v a2 s .c o m*/ }
From source file:Main.java
public static void showToast(Context context, String msg) { Toast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT); //toast.setGravity(Gravity.TOP|Gravity.LEFT, 0, 10); toast.show(); }
From source file:Main.java
public final static void showToastMessage(Context context, String message) { Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); toast.show(); }
From source file:Main.java
public static void toastMsg(String msg, Context con) { Toast toast = Toast.makeText(con.getApplicationContext(), msg, Toast.LENGTH_LONG); toast.setGravity(Gravity.TOP, 0, 80); toast.show(); }
From source file:Main.java
public static void showToast(Context context, String message) { Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); }
From source file:Main.java
public static void longToast(int string, Context ctx) { Toast t = new Toast(ctx).makeText(ctx, string, Toast.LENGTH_LONG); t.setGravity(Gravity.TOP, 0, dpToPx(55, ctx)); t.show(); }
From source file:Main.java
public static void shortToast(int string, Context ctx) { Toast t = new Toast(ctx).makeText(ctx, string, Toast.LENGTH_SHORT); t.setGravity(Gravity.TOP, 0, dpToPx(55, ctx)); t.show(); }
From source file:Main.java
/** * A method to create a toast message on any screen. * * @param activity : screen on which the toast message should be shown. * @param msg : the message to be shown. *//*from w w w . jav a2 s . c o m*/ public static void createToastMessage(final Activity activity, final String msg) { if (!isNullOrEmpty(msg)) activity.runOnUiThread(new Runnable() { @Override public void run() { Toast toast = Toast.makeText(activity.getApplicationContext(), msg, Toast.LENGTH_SHORT); toast.show(); } }); }