android: LoginDialog refactored so it also works when the device is rotated