error 1001 while updating current user

Hi Backendlesses!
having a problem updating the current user in my android app. I’ve put a toast at the fault and it says “1001”.
trying to update the users’ “about” property, my method is:

public void userVpressed (View view){
textabout = (EditText) findViewById(R.id.editTextabout);
user.setProperty(“about”, textabout.getText());
Backendless.UserService.update( user, new AsyncCallback<BackendlessUser>()
{
public void handleResponse( BackendlessUser user )
{
// user has been updated
Intent intent = new Intent( UserEditActivity.this, UserActivity.class );
startActivity( intent );
}
public void handleFault( BackendlessFault fault )
{
// user update failed, to get the error code call fault.getCode()
Toast.makeText(UserEditActivity.this, fault.getCode(), Toast.LENGTH_LONG).show();
}
});
}I’ve defined the user variable above the “onCreate” method:BackendlessUser user = Backendless.UserService.CurrentUser();
I think that maybe it has something to do with this line from the tutorial:Backendless.UserService.login( username, password, new AsyncCallback<BackendlessUser>()
I don’t have that in my code. do I need to pass the username and password of the current user to every activity I’ve created ? doesn’t Backendless do it automatically ?Thanks!Gil.

I think that my problem is that I log in with facebook, and I don’t know how to make the login persistent. I need to re-login each time I run the app.

how do I make it persistent (like in adding “true” if I wouldn’t have logged in with facebook) ?

and then how to I access that current user in different activities ?

thanks a lot!
Gil.

Hi!

In method loginWithFacebook() you can use parameter stayLoggedIn.
For method loginWithFacebookSdk() this option will be added soon.
Regards,
Kate.

Thanks Kate,

but Android Studio doesn’t accept “stayLoggedIn” or “true” in the loginWithFacebook command
Backendless.UserService.loginWithFacebook(MainActivity.this, null, facebookFieldMappings,
permissions, new AsyncCallback<BackendlessUser>() {
I’ve tried variations of :Backendless.UserService.loginWithFacebook(MainActivity.this, null, facebookFieldMappings,
permissions, new AsyncCallback<BackendlessUser>(), stayLoggedIn) {and variations with “true”.didn’t work. what am I missing ?

Could you try grabbing the jar from here and try it again?:

you want me to replace the backendless.jar in my project?

how do I download the file ? can’t find a download button for the backendless.jar.

Click on the file, then click “View Raw”

thanks Mark. did it but nothing has changed.

how do I add the stayLoggedIn to : Backendless.UserService.loginWithFacebook(MainActivity.this, null, facebookFieldMappings, permissions, new AsyncCallback<BackendlessUser>() {?maybe it’ working but I write the wrong syntax.thanks!

I meant to say that maybe you could show where to add the “stayLoggedIn” in the syntax…

help :slight_smile: