Android Toast Create showToast(final String toast, final Context context)

Here you can find the source of showToast(final String toast, final Context context)

Description

show Toast

Declaration

public static void showToast(final String toast, final Context context) 

Method Source Code

//package com.java2s;
import android.content.Context;

import android.os.Looper;

import android.widget.Toast;

public class Main {
    public static void showToast(final String toast, final Context context) {
        new Thread(new Runnable() {

            @Override/*w  w w  .j av a 2 s .c om*/
            public void run() {
                Looper.prepare();
                Toast.makeText(context, toast, Toast.LENGTH_SHORT).show();
                Looper.loop();
            }
        }).start();
    }
}

Related

  1. showToast(final Context context, final String string)
  2. showToast(final Context context, final int resId)
  3. showToast(final Context ctx, final Handler handler, final String text, final int duration)
  4. showToast(final Context ctx, final Handler handler, final int id, final int duration)
  5. showToast(final String toast, final Context context)
  6. showToastInThread(final Context context, final String msg)
  7. toast(String message, Context context)
  8. toast(final Context context, final CharSequence msg)
  9. msgLong(Context context, String msg)