我想记录这个异常,但我不知道该怎么做:
catch (ParseException pe) {
updateStatus("Connection Error.");
我想记录这个异常,但我不知道该怎么做:
catch (ParseException pe) {
updateStatus("Connection Error.");
如果通过记录这个异常你的意思是写一行到 LogCat,只需使用Log
类:
Log.e("tag", "Some error message you want to log");
使用 android.util.Log 类:
Log.e("App-or-Class-identifier-for-filtering", "error message", pe);
您也可以使用 pe.printStackTrace() 。