Error Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)
Asked
Active
Viewed 1,313 times
-2

Harlan Mukdis
- 67
- 1
- 5
-
2It is a NullPointerException. because your are getting String success 'null'. Google it. – Krupal Shah May 09 '16 at 18:06
-
1Possible duplicate of [What is a Null Pointer Exception, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-null-pointer-exception-and-how-do-i-fix-it) – Krupal Shah May 09 '16 at 18:08
1 Answers
0
For booleans, use if(success) or if(!success). not success.equals(Object o). That is provided success is a boolean. In any case, whatever object that is, it was not initialized so it is null (if it's a boolean it's false). If it's a string initialize it and make sure it's not null. then you can compare. In any case, you cannot compare a string to an integer. I am guessing, it's a boolean. So just use if(success).

daxgirl
- 762
- 4
- 10