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 {
    public static void ShowToast(Context context, String message) {
        Toast msg = Toast.makeText(context, message, Toast.LENGTH_SHORT);
        msg.setGravity(Gravity.CENTER, msg.getXOffset() / 2, msg.getYOffset() / 2);
        msg.show();
    }
}