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

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

Description

show Toast

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;

import android.view.Gravity;
import android.widget.Toast;

public class Main {
    public static void showToast(final Context context, final String message) {
        final Toast makeText = Toast.makeText(context, message,
                Toast.LENGTH_LONG);/* w  w w.jav  a2 s .c o m*/
        makeText.setGravity(Gravity.TOP, 0, 0);
        makeText.show();
    }
}

Related

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