Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;
import android.view.Gravity;

import android.widget.Toast;

public class Main {
    /*****************************************************************************
     * Function: serviceToast
     * Date March 5, 2015
     * Revision:
     *
     * Designer: Jeff Bayntun
     *
     *Programmer: Jeff Bayntun
     *
     *Interface: void serviceToast(Context c, String text, int duration)
     *              Activity c -- Current activity
     *              String text -- toast text
     *              int duration -- duration of the toast
     *
     *Returns:
     *         void
     *
     * Notes:
     *  Creates a toast on the screen.
     **************************************************************************/
    public static void serviceToast(Context c, String text, int duration) {
        Toast t = Toast.makeText(c, text, duration);
        t.setGravity(Gravity.CENTER, 0, 0);
        t.show();
    }
}