Skip to content

Instantly share code, notes, and snippets.

@foghina
Last active August 13, 2016 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foghina/926c796e9bfdb5e6c71be4de39d22f81 to your computer and use it in GitHub Desktop.
Save foghina/926c796e9bfdb5e6c71be4de39d22f81 to your computer and use it in GitHub Desktop.
  • 46dc46a changes when we clear the current activity from the ReactContext: moved it from onPause to onDestroy. This is generally good news, as you have access to the Activity in more situations, but if you were relying on the Activity being null in paused state, you'll need to change your code.
  • 0b5c612 changes how we forward Activity lifecycle events to listeners: we no longer send events generated by background Activities. The biggest implication of this is probably that, if you are using multiple React Activities, won't receive onHostDestroy() until the last React Activity is destroyed. Furthermore, if you're writing your own custom activities, make sure to call the new API (ReactInstanceManager#onHostPause(Activity) and co.) to benefit from this.
  • 3c4fd42 adds a FragmentActivity-based React Activity class, to support using libraries that rely on this. In order to achieve DRY, most of the Activity methods (onCreate, getReactNativeHost etc.) are now delegated to ReactActivityDelegate. If you're overriding any methods called by RN, you might need to move them to a custom delegate class by overriding createReactActivityDelegate().
  • fbd2e13 adds an Activity argument to onActivityResult. If you're calling ReactInstanceManager#onActivityResult() manually or if you implement ActivityEventListener you'll need to add this argument as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment