Debugging return statement within catch block

后端 未结 1 1734
你的背包
你的背包 2021-01-26 03:22

I\'m developing an android application where I use the following snippet:

private Boolean myMethod(boolean isOnline) {
    try {
        if (isOnline) {
                 


        
1条回答
  •  失恋的感觉
    2021-01-26 04:03

    Your mistake is adding this block:

    catch (Exception e) { 
        this.e = e;
        return false;
    }
    

    It will catch everything, leading to your XmlPullParserException not being called IMO.

    0 讨论(0)
提交回复
热议问题