Android Toast Create showMessage(final Activity context, final String message)

Here you can find the source of showMessage(final Activity context, final String message)

Description

show Message

Declaration

public static void showMessage(final Activity context,
            final String message) 

Method Source Code

//package com.java2s;

import android.app.Activity;

import android.widget.Toast;

public class Main {
    public static void showMessage(final Activity context,
            final String message) {
        context.runOnUiThread(new Runnable() {

            @Override//w  w w.  j a va 2  s .  c o  m
            public void run() {
                Toast.makeText(context, message, Toast.LENGTH_LONG).show();
            }
        });

    }
}

Related

  1. toast(Context context, String text)
  2. toast(Context c, String msg)
  3. showToastShort(Activity ctx, String text)
  4. showToastLong(Activity ctx, String text)
  5. showMessage(Context ctx, String msg)
  6. showFailure(Activity activity, int id)
  7. showElapsed(long start, long end, Context ctx)
  8. formatToastDist(String message, int value, String unit)
  9. formatToastTemp(String message, int value, String unit)