Java tutorial
//package com.java2s; //License from project: Open Source License import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; public class Main { static Handler mHandler; public static void LogPass(boolean pass, String message) { if (pass) { PrintLog("PASS -" + message); Log.e("Test", "PASS -" + message); } else { PrintLog("-FAILE -" + message); Log.e("Test", "-FAILE -" + message); } } public static void PrintLog(String text) { if (mHandler != null) { Message meg = new Message(); Bundle bundel = new Bundle(); bundel.putString("MESSAGE", text); meg.setData(bundel); mHandler.sendMessage(meg); } } }