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 isDebug = true;
    private static String debugTag = "View";

    /**
     * Debug.
     *
     * @param message the message
     */
    public static void debug(String message) {
        debug(debugTag, message);
    }

    /**
     * Debug.
     *
     * @param object  the object
     * @param message the message
     */
    public static void debug(Object object, String message) {
        debug(object.getClass().getSimpleName(), message);
    }

    public static void debug(String tag, String message) {
        if (isDebug) {
            try {
                Log.d(debugTag + tag, message);
            } catch (Exception e) {
                System.out.println(tag + ">>>" + message);
            }
        }
    }
}