开发者

how to catch android force to close

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜