Display Toast with the input message - Android User Interface

Android examples for User Interface:Toast

Description

Display Toast with the input message

Demo Code


//package com.java2s;
import android.app.Activity;

import android.widget.Toast;

public class Main {
    /**// w w  w.j  a v a  2s . com
     * Display Toast with the input message
     * @param activity - {@link Activity} instance
     * @param message - Message to be displayed in Toast
     */
    public static void showToast(Activity activity, String message) {
        Toast.makeText(activity, message, Toast.LENGTH_LONG).show();
    }
}

Related Tutorials