Chapter 12 pg 242


Continuing the discussion from Errata (3rd Edition):

the code reads in the book:
if (resultCode != Activity.RESULT_OK){ return; }

should read:
if (resultCode == Activity.RESULT_OK){ return; }


In that case, the code is correct as written. In the onActivityResult method, you want to continue with the method only if you get the Activity.RESULT_OK result code.

If the result code is RESULT_CANCELED, then you want to bail out of that method and not try to read the result.


Yeah you’re right I made a simple mistake and put requestCode instead of resultCode very important!! lol

thanks for the response the book is great!

Angel Rodriguez