Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.app.Activity;

import android.widget.Toast;

public class Main {
    public static void showMsg(final Activity act, final String msg, final boolean isLongShow) {
        act.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                // TODO Auto-generated method stub
                if (isLongShow) {
                    Toast.makeText(act, msg, Toast.LENGTH_LONG).show();
                } else {
                    Toast.makeText(act, msg, Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
}