Refactor showDialog() in RegisterActivity