Hi there
Was working on my app and tried to login via backendless as an account - something that worked perfectly so far.
but now (without even touching this class), it is causing me a NullPointerException and crashes my app.
wired thing is - the debugger sends me inside the handleResponse method:
my code:
` findViewById(R.id.btnLogin).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String uName = ((EditText)findViewById(R.id.txtUser)).getText().toString();
String uPass = ((EditText)findViewById(R.id.txtPass)).getText().toString();
Backendless.UserService.login(uName, uPass, new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser response) {
? true : false;
if ((boolean) response.getProperty("isAdmin")) {
startActivity(new Intent(context, AdminActivity.class));
Log.e("admin activity","went to admin");
} else {
Intent intent = new Intent(context, ClientActivity.class);
intent.putExtra("name", response.getProperty("name").toString());
startActivity(intent);
Log.e("client activity","went to client");
}
}
`
what im getting:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at com.hackeru.mybackendless.MainActivity$1$1.handleResponse(MainActivity.java:97)
at com.hackeru.mybackendless.MainActivity$1$1.handleResponse(MainActivity.java:91)
when line 97 is -
if ((boolean) response.getProperty(“isAdmin”)) {
any help?