Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Reflecting incorrect value upon change in Name in SettingsActivity #430

Open
abs51295 opened this issue Mar 11, 2017 · 1 comment
Open

Comments

@abs51295
Copy link
Member

Application is not showing toast Please enter a valid name on incorrectly entering the Name of the user, the first time and it is also reflecting the change inside the dialog box.

settings_bug

Also I noticed this behavior:

  • Unless you enter a valid name, the incorrect name is not changed in the dialog box.
    For Example: If you enter 666 after 5555555 in the dialog box above, it will show you toast but when you open it again it will show you 5555555 only.

  • If you enter the valid name first and then invalid name then it's not a problem. The above problem is faced only when entering incorrect name as the first edit after opening the activity.

  • If you enter a valid name after an invalid name then it is updated fine even in this case.

@Pooja-Mahadev-Soundalgekar

I would like to work on this. UserSettingsActivity.java contains the code for this activity. The reason why the toast for "enter a valid name" does not come up the first time is because in line 104 of UserSettingsActivity.java, there is no code to show the Toast. The toast is shown only in the onPreferencesChange() function and this function executes only from the second time the name is changed.

The second issue you have mentioned is that the EditText shows the previously entered invalid name. This is because the shared preference is not reverted back when you enter an invalid name the first time. So, we must run a code similar to what is present in the onPause() function here.

This will solve the issues mentioned here. @sandarumk @abs51295 Can I send a PR fixing this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants