Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.util.Log;

public class Main {
    private static boolean show = true;

    /**
     * Logs the data to the android Log.i . 
     * 
     * @param tag
     * @param msg
     */
    public static void i(String tag, String... msg) {
        if (show) {
            Log.i(tag, toString(msg));
        }
    }

    private static String toString(String... msg) {
        if (msg == null || msg.length == 0) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        for (String m : msg) {
            if (msg != null) {
                sb.append(m);
            } else {
                sb.append("null");
            }
        }
        return sb.toString();
    }
}