Update passwords with Android Autofill Framework

I have created an app with a basic login/signup process that uses the Android Autofill Framework to save the username and password.

When a user changes their password, is there a way to force the Android Autofill Framework to update the password automatically?

// code for login/signup
// code for password change

Yes, you can use the AutofillManager’s notifyValueChanged() method to inform the Autofill Framework that a field’s value has changed. In your password change code, after updating the password, you can call this method on the password field to trigger the update:

// Get the AutofillManager
AutofillManager autofillManager = context.getSystemService(AutofillManager.class);

// Get the password field
EditText passwordField = findViewById(R.id.password_field);

// Notify the Autofill Framework that the password has changed
autofillManager.notifyValueChanged(passwordField);