That said, regarding your code there are several weird things:
- Validation is done in the onCreate method before any user input. It also short circuits before the progress bar is shown (might be intentional)
- The on Click Listener is nested and registers the next listener after the first click
- The useless when clause
- No longer indication as to what should happen when validation is successful (where is the call to the actual registration?)