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.
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 ?
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!