如何解决尝试调用虚方法' boolean java.lang.String.equalsIgnoreCase(java.lang.String)?

时间:2017-09-01 06:04:07

标签: android

我有一个应用程序,其中我收到错误"尝试调用虚方法' boolean java.lang.String.equalsIgnoreCase(java.lang.String)"请解释一下

的含义和解决方案

代码: -

 String receivedResult = parseJsonResultSetFav(result);
            if (receivedResult.equalsIgnoreCase("SUCCESS")) {
                CustomerTicketDialogClass ctdc = new CustomerTicketDialogClass(getActivity(),
                        "successful", "successfully sent mail to your email id ", "ViewDetails");
                ctdc.show();
                ctdc.setCanceledOnTouchOutside(false);
            } else {
                CustomerTicketDialogClass ctdc = new CustomerTicketDialogClass(getActivity(),
                        "failure", receivedResult, "ViewDetails");
                ctdc.show();
                ctdc.setCanceledOnTouchOutside(false);
            }

1 个答案:

答案 0 :(得分:0)

是的,你得到NullPointerException,所以为了避免这种情况..

if(receivedResut != null && receivedResult.equalsIngnoreCase("SUCCESS"))