if (!checkValidity()) return;
if (mProfile != null) {
- mProfile.setName(profileName.getText());
- mProfile.setUrl(url.getText());
- mProfile.setPostingPermitted(postingPermitted.isChecked());
- mProfile.setAuthEnabled(useAuthentication.isChecked());
- mProfile.setAuthUserName(userName.getText());
- mProfile.setAuthPassword(password.getText());
- mProfile.setThemeId(huePickerView.getTag());
+ updateProfileFromUI();
// Log.d("profiles", String.format("Selected item is %d", mProfile.getThemeId()));
mProfile.storeInDB();
Log.d("profiles", "profile stored in DB");
profileName.requestFocus();
}
+ private void updateProfileFromUI() {
+ mProfile.setName(profileName.getText());
+ mProfile.setUrl(url.getText());
+ mProfile.setPostingPermitted(postingPermitted.isChecked());
+ mProfile.setAuthEnabled(useAuthentication.isChecked());
+ mProfile.setAuthUserName(userName.getText());
+ mProfile.setAuthPassword(password.getText());
+ mProfile.setThemeId(huePickerView.getTag());
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {