Storing the password on the original object would be problematic in case
the user mistypes the password (no prompt would be shown the second time).
An alternative would be to just return the ID of the selected profile
and then fetch it from the database.
@Override
public void onClick(DialogInterface dialog, int whichButton)
{
+ /* let's work on a clone of the profile when updating the password */
+ activeProfile = activeProfile.clone();
activeProfile.setPassword(password.getText().toString().trim());
prepareVpnService();
}