Back to project page egotrip.
The source code is released under:
Apache License
If you think the Android project egotrip listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.myegotrip.egotrip.utils; // ww w. j av a2 s . c om import net.myegotrip.egotrip.R; import android.app.Activity; import android.os.Handler; import android.os.Message; import android.util.Log; import android.widget.TextView; public class Debug { TextView txt; Activity act; public Debug(Activity act) { this.act = act; init(); } private void p(String msg) { Log.d("DebugView" , msg); } private void init() { txt = (TextView) act.findViewById(R.id.txtDebug); p("created debug view" ); } public void add(String text) { Message m = new Message(); m.obj = text; handler.sendMessage(m); } private Handler handler = new Handler() { public void handleMessage(Message msg) { String text = (String)msg.obj; if (txt == null) return; if (txt.getText()!= null && txt.getText().length()>1000) { clear(); } txt.append(text); }; }; public void clear() { txt.setText(""); } }