show Toast to display message - Android User Interface

Android examples for User Interface:Toast

Description

show Toast to display message

Demo Code


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

public class Main {
    public static void showToast(Context context, String message) {
        Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
        toast.show();/*from w  w w  .  j  a v a  2s  . c o  m*/
    }
}

Related Tutorials