I am working on parse.com and updating current user data. I just want to update the current user information in another data for example "UserInfo" table, in which I want to put some updated values.
Code snippet for current user is given below:
ParseUser user = ParseUser.getCurrentUser();
user.put("firstName", fName.getText().toString());
user.put("lastName", lName.getText().toString());
user.put("email", mailText.getText().toString());
user.put("contactNumber", mobileText.getText().toString());
/*user.put("dob", medCond.getText().toString());
user.put("lastName", medication.getText().toString());
user.put("lastName", docInfo.getText().toString());*/
user.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
// dismissLoadingDialog();
if (e == null) {
Toast.makeText(getApplicationContext(), "User Profile Has Been Updated!",
Toast.LENGTH_SHORT).show();
} else {
Logs.e(getClass().getName(), e.toString());
Toast.makeText(getApplicationContext(), "Exception/n"+e,
Toast.LENGTH_SHORT).show();
// howMessage(e.getMessage());
}
}
});
But I want to update few values in my another table also. The following code is making every new entry in data bases. I want to make only an update not creation of new row.
final ParseObject update = new ParseObject("UserInfo");
update.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException arg0) {
// TODO Auto-generated method stub
update.put("blood", spinnerOsversions.getSelectedItem().toString());
update.put("doc", "");
update.put("medicate", "ldldm");
update.put("medical", "cdlmldm");
update.put("medicalCond", "lalalla");
update.put("allergy", "Twice A Day");
update.saveInBackground();
}
});