Android: requestCode and resultCode

There is nothing special about the integers -- those constants are simply a convention. Your onActivityResult could be a single switch statement that dispatches results to methods to deal with them... no need for it to be giant. One should, of course, be using symbolic constants, as it appears you are.


Is there anything special about the built-in resultCodes, like RESULT_CANCELED? The documentation on the developer site seems to suggest that the built-in results are simply integers.

Yes. These codes are "standard" responses. For example, if an activity you started returns RESULT_CANCELED (in particular, an OS activity or a standard app such as the Camera), that means the activity was cancelled. These standard results should be interpreted according to the documentation. In fact, your activities should use these standard results (so that other app developers have an easier time starting your activities) unless there is a strong reason not to do so.

And it seems to me that this could get really messy? For example, if I had 10 possible activities to launch, then I'd have to have a giant onActivityResult function to check which activity's being returned, wouldn't I?

Yes. Use a switch statement to handle these.