开发者

how to catch android force to close

开发者 https://www.devze.com 2023-01-30 05:36 出处:网络
Now i am working json application.The Force close message occured the app is crosed.so how to catch force to close e开发者_运维问答rror in try catch exception.Help me.....put log.d commands everywhr

Now i am working json application.The Force close message occured the app is crosed. so

how to catch force to close e开发者_运维问答rror in try catch exception.Help me.....


put log.d commands everywhr and check the log messages in the log view....

open window > Android > Log


While defining your message give : throws JSONException and put the code that raises exception inside try block. After try block, give Catch statement as :

catch(Exception e) {
    throw new JSONException(e.getMessage());
}


If you're trying to avoid surround all cod with try/catch blocks, you can use thread.setUncaughtExceptionHandler Check it out

Another way is to use ACRA to get logs Error from your APP, ACRA

0

精彩评论

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