当前位置: 代码迷 >> Android >> android开发中的错误小工具
  详细解决方案

android开发中的错误小工具

热度:78   发布时间:2016-05-01 11:24:20.0
android开发中的异常小工具
package com.zzl.tools;import android.util.Log;public class Tool {			/**	 * android开发中的异常处理类,如有异常用log输出	 * Tag:ExceptionLocation	 * class:发生异常的类	 * LineNumber:出现的异常位于哪一行,	 * info:异常信息,即什么异常。	 */	public static void getExceptionLineNumberAndInfo(Exception e) {		StackTraceElement[] trace = e.getStackTrace();		if (trace == null || trace.length == 0){					}else{			//System.out.println("ExceptionLocation  :"+"class="+trace[0].getClassName()+";LineNumber="+trace[0].getLineNumber()+" "+e.toString());			Log.i("ExceptionLocation", "class="+trace[0].getClassName()+";LineNumber="+trace[0].getLineNumber()+" ;info: "+e.toString());		}			}}
1 楼 aduo_vip 2013-03-04  
 
  相关解决方案