Android app dev: Intent extras set in onBackPressed() misssing when back to onActivityResult()

It’s funny how we spent about an hour trying to figure out why the Intent extras that we’re setting are not being sent back to onActivityResult(). If we only knew that the solution was as simple as moving one line of code.

The call to super.onBackPressed() should be placed after setting Intent extras and after finishing the current activity. Like so:

Related Posts:

Posts that may be related to "Android app dev: Intent extras set in onBackPressed() misssing when back to onActivityResult()":

Catzie

An odd human being who happens to have a variety of ever-changing interests, but right now they are programming, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert/drink flavors, obsessing about finding out how some things works, automation, anime, video games... Ran online dessert shops Cookies PH and Catzie's Cakery in her past life.

Leave a Reply

Your email address will not be published. Required fields are marked *