/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.anil.mynewapp, PID: 408 java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.example.anil.mynewapp.SignupAuthentication.signupAuthentication(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)' on a null object reference at com.example.anil.mynewapp.Second$1.onClick(Second.java:40) at android.view.View.performClick(View.java:6294)
Asked
Active
Viewed 435 times
2 Answers
0
This error tells you everything you need to know. In your onClick event, you are calling signupAuthentication() on your SignupAuthentication object but that object is null.

Robert Nekic
- 3,087
- 3
- 24
- 36
-
public boolean signupAuthentication(String name,String username,String email,String password,String contact){ boolean flag = true; if((nameVerifire(name) == false) || name.equals("") || username.equals("") || email.equals("") || password.equals("") || contact.equals("") || (emailVerifire(email) == false) || (contactVerifire(contact) == false)){ // mainactv.showError(); flag = false; } return flag; } – 999anil Jan 19 '18 at 18:13
-
You are calling SignupAuthentication.signupAuthentication(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String). The first part of that, SignupAuthentication, is null. You can't call a method on a null object. This would be a lot easier to explain if your class and method weren't named the same. Sigh. – Robert Nekic Jan 19 '18 at 18:16
-1
You have a null object. I suggest using System.println() on whatever object you are trying to call in the performClick method.
Avoid only posting the trace stack as it is difficult to debug without having more information.

John Peurifoy
- 87
- 6