A number of developers preach a single activity architecture on Android, which is something I’ve been trying to move forward to as well. In the process, though, I ran into one tricky problem. I don’t have something like
startActivityResult for fragments. If you’re unfamiliar,
startActivityForResult is a method that allows you to launch an activity with a specific request code, and when that activity finishes, your first activity will get a callback in
onActivityResult and can do stuff with it.
This post is going to walk through how we can achieve that same affect using fragments.