我有一个应用程序,其中我收到错误"尝试调用虚方法' 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);
}
答案 0 :(得分:0)
是的,你得到NullPointerException,所以为了避免这种情况..
if(receivedResut != null && receivedResult.equalsIngnoreCase("SUCCESS"))