开发者

Android, exception in non-ui thread

开发者 https://www.devze.com 2023-03-07 19:29 出处:网络
Is there anyway that I could set the DDMS, so that it could capture exceptions from non-ui thread in eclipse? It took me long enough to realize that if an exception occur in non-ui thread, the program

Is there anyway that I could set the DDMS, so that it could capture exceptions from non-ui thread in eclipse? It took me long enough to realize that if an exception occur in non-ui thread, the program won't be effected much, at least in my case. Basically I have the following code:

new Thread(new Runnable(){
    public void run(){
         A.errorMethod();
    }
}).start();

When I run the app,it just halt while doing errorMethod, but there is no exception message shown. After I took the A.errorMethod(); part out and run it directly, I got the except开发者_Go百科ion message in Logcat, weird.


try to let the debugger bind to the thread using:

new Thread(new Runnable(){
    public void run(){
         Debug.waitForDebugger();
         A.errorMethod();
    }
}).start();
0

精彩评论

暂无评论...
验证码 换一张
取 消