Java tutorial
//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_Short(Context context, String text) { Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); } }