Error: 'Boolean java.lang.String.equals(java.lang.Object)'

Asked

Viewed 327 times

0

This is a program, which, behind the calculator, stores files that you think are important. The error message field I believe is not his and the Super SU or Android system, because every time, in any program that has to have a deeper access it opens the same field style saying that granted permission. But this time an error occurred. Could anyone help me to solve this problem?

screenshot no celular

  • 4

    but is developing this application? Or is it a mistake of any application that already exists?

  • 1

    Put your code guy, this way your question will receive downvotes and will be closed. Another thing you are comparing a Boolean with an Object?

  • 1

    @Wellingtonavelino in this case Boolean is the return type of the equals method.

  • 1

    @Wellingtonavelino the boolean is the function equals

  • I didn’t get it right then, I thought it was something else not his return. hahaha

  • 1

    Your problem is called java.lang.NullPointerException. See more here: http://answall.com/a/63736/132

Show 1 more comment

1 answer

2

The error informed by you indicates that somewhere in your code you are doing str1.equals(str2); whereas str1 is a null object, i.e., you are referencing a null object.

check in your code the places where you are using the method equals to find where your mistake is.

Example that will give the error:

String str1 = null;
String str2 = "teste";
boolean ret = str1.equals(str2);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.