Replaced if statement with switch in onActivityResult