Android Toast Create displayToast(String message, Activity activity)

Here you can find the source of displayToast(String message, Activity activity)

Description

display Toast

Declaration

public static void displayToast(String message, Activity activity) 

Method Source Code

//package com.java2s;

import android.app.Activity;

import android.view.Gravity;

import android.widget.Toast;

public class Main {
    public static void displayToast(String message, Activity activity) {
        Toast toast = Toast.makeText(activity, message, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER_VERTICAL
                | Gravity.CENTER_HORIZONTAL, 0, 0);
        toast.show();/*from   ww  w.j a  va  2  s  . c o m*/
    }
}

Related

  1. formatToastTemp(String message, int value, String unit)
  2. showMessage(final Activity activity, final String message)
  3. showToast(Activity activity, String message)
  4. showToast(final Activity ctx, final String text, final int position, final boolean alive)
  5. makeToast(String msg, int length, Activity mainAct)
  6. showToast(Context context, String message)
  7. showToast(Context context, int id)
  8. showToast(Context context, int stringId)
  9. showToast(String text, Context context)