if i update the Users table and then close the app and run it again then i have to login again

i have enabled the stay logged in and works fine but when i update the entry in users table using following code

SharedPreferences prefs = getSharedPreferences(“MyPref”, MODE_PRIVATE);
String email = prefs.getString(“email”, null);
String password = prefs.getString(“pwd”, null);
// Toast.makeText(Account_Edit.this, email+" , "+password, Toast.LENGTH_LONG).show();

if (isAccEditValuesValid(mobile, dob, address, city, pincode)) {
final ProgressDialog mProgressDialog;
mProgressDialog = new ProgressDialog(this);
mProgressDialog.setCancelable(false);
mProgressDialog.setMessage(“Updating Info…”);
mProgressDialog.show();
Backendless.UserService.login( email, password, new AsyncCallback<BackendlessUser>()
{
public void handleResponse( BackendlessUser user )
{
// user has been logged in, now user properties can be updated

         user.setProperty( "address", address.toString() );
         user.setProperty( "city", city.toString() );
         user.setProperty( "dob", dob.toString() );
         user.setProperty( "pincode", pincode.toString() );
         user.setProperty( "mobile", mobile.toString() );

         Backendless.UserService.update( user, new AsyncCallback&lt;BackendlessUser&gt;()
         {
             public void handleResponse( BackendlessUser user )
             {
                 if(parent_activity==null) {
                     Intent homescreen_redirect = new Intent(Account_Edit.this, HomeScreen.class);
                     finish();
                     mProgressDialog.hide();
                     startActivity(homescreen_redirect);
                     overridePendingTransition(R.anim.pull_in_right, R.anim.push_out_left);
                     //Toast.makeText(Account_Edit.this, "case 1", Toast.LENGTH_LONG).show();
                 }else if(parent_activity!=null){
                     Intent review_callback = new Intent(getBaseContext(), Review_order.class);
                     review_callback.putExtra("address" , address.toString());
                     review_callback.putExtra("city" , city.toString());
                     review_callback.putExtra("pincode" , pincode.toString());
                     review_callback.putExtra("mobile" , mobile.toString());
                     mProgressDialog.hide();
                     setResult(Review_order.RESULT_OK, review_callback);
                     finish();
                    //Toast.makeText(Account_Edit.this, "case 2", Toast.LENGTH_LONG).show();
                 }

             }

             public void handleFault( BackendlessFault fault )
             {
                 Toast.makeText(Account_Edit.this, "Error 1 "+fault, Toast.LENGTH_LONG).show();

             }
         });
     }

     public void handleFault( BackendlessFault fault )
     {
         Toast.makeText(Account_Edit.this, "Error 2 "+fault, Toast.LENGTH_LONG).show();

     }
 });

}
i have to login again when i close app and open it again

Hi,

But you update user you have loged in. So you should relogin him.

Regards,

Denys

is there any way to retain login ?

as only address city mobile pincode are being updated
and not the username and password

Hi, Karanveer.

User token is invalidated after user is updated. This means you have to login user again after updating any of his values.

Hi, Karanveer.

We decided to put the update concerning your topic on our next iteration roadmap. This will allow to update the loggined users without need for them to relogin (unless the Identity field or password are updated).
The internal ticket for this is BKNDLSS-12906
Thanks for bringing our attention to this.

Hi, Karanveer.
I just checked your issue again.

The user is updated via SDK request it’s user-token is not invalidated. At which line of the code your provided you can see that you need to login again?
At the moment I do not see anything wrong with Backendless service.