Chapter 12 pg 242


#1

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; }


#2

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.


#3

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
https://www.linkedin.com/in/angel-rodriguez-495bb1135/