<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head>
<card title="Android开发怎么调试的实例 android.util.Log" id="card1">
<p> 游客</p><p>
标题:Android开发怎么调试的实例 android.util.Log<br/>
正文:<br/>
　　package AndroidApi;　　import android.util.Log;　　class Monitoring implements Runnable　　{　　public void run()　　{　　while (!Thread.currentThread().isInterrupted())　　{　　try　　{　　Thread.sleep(100);　　} catch (InterruptedException s)　　{　　Thread.currentThread().interrupt();　　}　　AndroidDebug.printVaryMemory();　　}　　}　　}　　public class AndroidDebug　　{　　private static boolean m_bIsDebug = false;　　/**　　* 设置调试模式　　*　　* @param bIsDebug　　*/　　public static void setMode(boolean bIsDebug)　　{　　m_bIsDebug = bIsDebug;　　}　　/**　　* 是否调试模式　　* @return　　*/　　public static boolean isDebug()　　{　　return m_bIsDebug;　　}　　/**　　* 打印信息　　*　　* @param strTxt　　*/　　public static void println(String strTxt)　　{　　if (m_bIsDebug)　　{　　System.out.println(strTxt);　　}　　}　　/**　　* 打印信息  @郑州网建　　*　　* @param strTxt　　*/　　public static void Log(String strTag, String strTxt)　　{　　if (m_bIsDebug)　　{　　Log.i(strTag,strTxt);　　}　　}　　/**　　* 强制回收垃圾,可用于检测析构函数,检测未使用对象是否有 @camnpr　　*/　　public static void gc()　　{　　if (m_bIsDebug)　　{　　System.gc();　　}　　}　　/**　　<br/><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1751&amp;Page=1">[&lt;&lt;]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1751&amp;Page=1">[[1]]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1751&amp;Page=2">[2]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1751&amp;Page=3">[3]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=1751&amp;Page=3">[&gt;&gt;]</a><br/>
<br/>
<a href="wap.asp?act=Com&amp;id=1751">查看评论(0)</a><br/>
<a href="wap.asp?act=AddCom&amp;inpId=1751">发表评论</a><br/><br/>

<br/>

<br/>
<a href="http://camnpr.com/wap.asp">首页</a>
</p>
</card>
</wml>