List of utility methods to do Toast Create
void | showToast(String text, Context context) Displays a text message via the toast notification system. Toast.makeText(context, text, Toast.LENGTH_SHORT).show(); |
void | showToast(final Context context, String text) show Toast if (null == context) { return; if (Looper.myLooper() != Looper.getMainLooper()) { if (handler == null) { handler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message msg) { ... |
void | showToast(final Context context, final String message) show Toast final Toast makeText = Toast.makeText(context, message,
Toast.LENGTH_LONG);
makeText.setGravity(Gravity.TOP, 0, 0);
makeText.show();
|
void | showToast(final Context context, final String string) show Toast Handler handler = new Handler(Looper.getMainLooper()); handler.post(new Runnable() { @Override public void run() { Toast.makeText(context, string, Toast.LENGTH_LONG).show(); }); |
void | showToast(final Context context, final int resId) show Toast Handler handler = new Handler(Looper.getMainLooper()); handler.post(new Runnable() { @Override public void run() { Toast.makeText(context, resId, Toast.LENGTH_LONG).show(); }); |
void | showToast(final Context ctx, final Handler handler, final String text, final int duration) Schedule a toast message to be shown via supplied handler. handler.post(new Runnable() { public void run() { Toast.makeText(ctx, text, duration).show(); }); |
void | showToast(final Context ctx, final Handler handler, final int id, final int duration) Schedule a toast message to be shown via supplied handler. handler.post(new Runnable() { public void run() { Toast.makeText(ctx, id, duration).show(); }); |
void | showToast(final String toast, final Context context) show Toast if (!isAppOnForeground(context)) return; new Thread(new Runnable() { @Override public void run() { Looper.prepare(); Toast.makeText(context, toast, Toast.LENGTH_SHORT).show(); Looper.loop(); ... |
void | showToast(final String toast, final Context context) show Toast new Thread(new Runnable() { @Override public void run() { Looper.prepare(); Toast.makeText(context, toast, Toast.LENGTH_SHORT).show(); Looper.loop(); }).start(); ... |
void | showToastInThread(final Context context, final String msg) show Toast In Thread Handler handler = new Handler(Looper.getMainLooper()); handler.post(new Runnable() { public void run() { showToast(context, msg); }); |