Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 默认情况下启用堆栈跟踪_Android_Eclipse_Debugging_Adb - Fatal编程技术网

Android 默认情况下启用堆栈跟踪

Android 默认情况下启用堆栈跟踪,android,eclipse,debugging,adb,Android,Eclipse,Debugging,Adb,当我这样做的时候: try{ row=inflater.inflate(R.layout.row2, parent, false); }catch(Exception e){ Log.e(TAG,"error",e); } 我得到了LogCat中预期的stacktrace。 但是,如果没有它,错误是未捕获的,但我仍然希望在未过滤的日志中有跟踪。但是为什么没有呢?没有它,我在“Debug”选项卡(调用堆栈?)中只看到一个exeption状态。有些地方无法使用try..catch,

当我这样做的时候:

try{
    row=inflater.inflate(R.layout.row2, parent, false);
}catch(Exception e){
    Log.e(TAG,"error",e);
}
我得到了LogCat中预期的stacktrace。 但是,如果没有它,错误是未捕获的,但我仍然希望在未过滤的日志中有跟踪。但是为什么没有呢?没有它,我在“Debug”选项卡(调用堆栈?)中只看到一个exeption状态。有些地方无法使用try..catch,例如在xml文件中

现在我面临一个运行时异常。未筛选的日志如下所示:

    09-06 20:48:22.760: DEBUG/dalvikvm(11430): GC_EXPLICIT freed 100K, 51% free 2658K/5379K, external 0K/0K, paused 97ms
    09-06 20:48:24.329: DEBUG/AndroidRuntime(11805): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
    09-06 20:48:24.329: DEBUG/AndroidRuntime(11805): CheckJNI is OFF
    09-06 20:48:24.329: DEBUG/AndroidRuntime(11805): setted country_code = The Netherlands
    09-06 20:48:24.329: DEBUG/AndroidRuntime(11805): setted sales_code = XEN
    09-06 20:48:24.334: DEBUG/AndroidRuntime(11805): found sales_code tag = <XEN>, </XEN> 
    09-06 20:48:24.334: DEBUG/dalvikvm(11805): creating instr width table
    09-06 20:48:24.404: DEBUG/LibQmg_native(11805): register_android_app_LibQmg
    09-06 20:48:24.409: DEBUG/DeviceEncryption(11805): JNI: register_android_deviceencryption_DeviceEncryptionManager
    09-06 20:48:24.430: DEBUG/AndroidRuntime(11805): Calling main entry com.android.commands.pm.Pm
    09-06 20:48:24.435: DEBUG/AndroidRuntime(11805): Shutting down VM
    09-06 20:48:24.435: DEBUG/dalvikvm(11805): GC_CONCURRENT freed 105K, 69% free 317K/1024K, external 0K/0K, paused 0ms+0ms
    09-06 20:48:24.435: DEBUG/dalvikvm(11805): Debugger has detached; object registry had 1 entries
    09-06 20:48:24.525: DEBUG/AndroidRuntime(11813): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
    09-06 20:48:24.525: DEBUG/AndroidRuntime(11813): CheckJNI is OFF
    09-06 20:48:24.525: DEBUG/AndroidRuntime(11813): setted country_code = The Netherlands
    09-06 20:48:24.525: DEBUG/AndroidRuntime(11813): setted sales_code = XEN
    09-06 20:48:24.525: DEBUG/AndroidRuntime(11813): found sales_code tag = <XEN>, </XEN> 
    09-06 20:48:24.530: DEBUG/dalvikvm(11813): creating instr width table
    09-06 20:48:24.545: INFO/DEBUG(2574): tid 11811 does not exist in pid 11805. ignoring debug request
    09-06 20:48:24.595: DEBUG/LibQmg_native(11813): register_android_app_LibQmg
    09-06 20:48:24.595: DEBUG/DeviceEncryption(11813): JNI: register_android_deviceencryption_DeviceEncryptionManager
    09-06 20:48:24.620: DEBUG/AndroidRuntime(11813): Calling main entry com.android.commands.am.Am
    09-06 20:48:24.620: INFO/Process(2786): Sending signal. PID: 11793 SIG: 9
    09-06 20:48:24.620: INFO/ActivityManager(2786): Force stopping package com.commonsware.cwac.tlv.demo uid=10111
    09-06 20:48:24.630: WARN/InputManagerService(2786): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40c1d338
    09-06 20:48:24.645: DEBUG/AndroidRuntime(11813): Shutting down VM
    09-06 20:48:24.645: DEBUG/dalvikvm(11813): GC_CONCURRENT freed 106K, 67% free 345K/1024K, external 0K/0K, paused 0ms+0ms
    09-06 20:48:24.645: INFO/ActivityManager(2786): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.commonsware.cwac.tlv.demo/.TouchListViewDemo } from pid 11813
    09-06 20:48:24.650: DEBUG/dalvikvm(11813): Debugger has detached; object registry had 1 entries
    09-06 20:48:24.675: INFO/ActivityManager(2786): Start proc com.commonsware.cwac.tlv.demo for activity com.commonsware.cwac.tlv.demo/.TouchListViewDemo: pid=11823 uid=10111 gids={1015}
    09-06 20:48:24.700: DEBUG/dalvikvm(11823): Debugger has detached; object registry had 1 entries
    09-06 20:48:24.705: WARN/ActivityThread(11823): Application com.commonsware.cwac.tlv.demo is waiting for the debugger on port 8100...
    09-06 20:48:24.710: INFO/System.out(11823): Sending WAIT chunk
    09-06 20:48:24.760: INFO/DEBUG(2574): tid 11819 does not exist in pid 11813. ignoring debug request
    09-06 20:48:25.205: WARN/ActivityManager(2786): Activity pause timeout for HistoryRecord{40c0b380 com.commonsware.cwac.tlv.demo/.TouchListViewDemo}
    09-06 20:48:25.734: INFO/dalvikvm(11823): Debugger is active
    09-06 20:48:25.919: INFO/System.out(11823): Debugger has connected
    09-06 20:48:25.919: INFO/System.out(11823): waiting for debugger to settle...
    09-06 20:48:26.120: INFO/System.out(11823): waiting for debugger to settle...
    09-06 20:48:26.324: INFO/System.out(11823): waiting for debugger to settle...
    09-06 20:48:26.524: INFO/System.out(11823): waiting for debugger to settle...
    09-06 20:48:26.724: INFO/System.out(11823): waiting for debugger to settle...
    09-06 20:48:26.930: INFO/System.out(11823): waiting for debugger to settle...
    09-06 20:48:27.130: INFO/System.out(11823): waiting for debugger to settle...
    09-06 20:48:27.324: INFO/System.out(11823): waiting for debugger to settle...
    09-06 20:48:27.530: INFO/System.out(11823): waiting for debugger to settle...
    09-06 20:48:27.729: INFO/System.out(11823): waiting for debugger to settle...
    09-06 20:48:27.930: INFO/System.out(11823): debugger has settled (1398)
    09-06 20:48:28.445: DEBUG/gps_sirf(2786): sirf_gps_inject_location: called
    09-06 20:48:28.505: INFO/wpa_supplicant(24796): SCAN_RESULTS : [5] 
    09-06 20:48:30.100: VERBOSE/WifiMonitor(2786): Event [ SCAN-RESULTS ]
    09-06 20:48:30.105: INFO/wpa_supplicant(24796): SCAN_RESULTS : [5] 
    09-06 20:48:30.120: INFO/wpa_supplicant(24796): SCAN_RESULTS : [5] 
    09-06 20:48:30.134: DEBUG/gps_sirf(2786): sirf_gps_inject_location: called
    09-06 20:48:30.160: INFO/wpa_supplicant(24796): SCAN_RESULTS : [5] 
09-06 20:48:22.760:DEBUG/dalvikvm(11430):GC_显式释放100K,51%释放2658K/5379K,外部0K/0K,暂停97ms

09-06 20:48:24.329:DEBUG/AndroidRuntime(11805):>>>>>>>AndroidRuntime START com.android.internal.os.RuntimeInit>AndroidRuntime START com.android.internal.os.RuntimeInit如果此代码引发异常,并且代码中任何地方都没有异常处理,那么您肯定会在logcat中看到它。

问题是调试器在异常时停止,在打印stacktrace之前。因此,您所要做的就是在调试面板中按几次恢复按钮(看起来像i>),跟踪就会被打印出来。当您在设备上看到“强制关闭”对话框时,跟踪必须在LogCat中。

您可能没有使用自定义异常处理程序类,是吗?首先,没有不能使用try/catch的地方。不过,我对你的问题感到惊讶,因为当抛出异常时,我没有显式地捕获它并记录它,我仍然在LogCat中看到它。