Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;

import android.os.Handler;
import android.os.Looper;

import android.widget.Toast;

public class Main {
    private static Handler sHandler = new Handler(Looper.getMainLooper());

    public static void showSafeToast(final Context context, final String text) {
        sHandler.post(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
            }
        });
    }
}