Skip to content

[Breaking] Exposed activity on clearHostOnActivityDestroy#3133

Merged
guyca merged 1 commit into
wix:masterfrom
SudoPlz:feature/expose_activity_on_clear_host
May 1, 2018
Merged

[Breaking] Exposed activity on clearHostOnActivityDestroy#3133
guyca merged 1 commit into
wix:masterfrom
SudoPlz:feature/expose_activity_on_clear_host

Conversation

@SudoPlz
Copy link
Copy Markdown
Contributor

@SudoPlz SudoPlz commented May 1, 2018

We do that in order to allow the end user to decide wether they want to destroy the host based on which activity we're about to destroy.

For example in our app we do the following:

@Override
    public boolean clearHostOnActivityDestroy(Activity activity) {
        // If the activity about to be destroyed is the SplashActivity
        if (activity.getClass() == SplashActivity.class) {
            // a.k.a an Instant Link was passed
            return true; // we want to destroy the host for that activity
            // If we returned false here, that will make the instant links get stuck on the Splash Screen for ever
        }

        // on every other case (i.e if NavigationActivity) we want the host to be kept intact
        // Otherwise we run the risk of getting "Tried to enqueue runnable on already finished thread: 'native_modules...
        return false;

    }

- We do that in order to allow the end user to decide
wether they want to destroy the host based on who's
the one calling onDestroy.
@SudoPlz SudoPlz changed the title Passing an activity to clearHostOnActivityDestroy Exposed activity on clearHostOnActivityDestroy May 1, 2018
@guyca guyca changed the title Exposed activity on clearHostOnActivityDestroy [Breaking] Exposed activity on clearHostOnActivityDestroy May 1, 2018
@guyca guyca merged commit ac95d36 into wix:master May 1, 2018
chilinh added a commit to chilinh/react-native-navigation that referenced this pull request May 26, 2018
* r_master: (31 commits)
  Fix syntax error: "screen" is read-only (wix#3237)
  Revert "- Fixes freeze of passProps on iOS (wix#3220)" (wix#3222)
  - Fixes freeze of passProps on iOS (wix#3220)
  allows you to show a lightbox directly after dismissing on ios (wix#1466)
  Enable RTL support on LeftButton (wix#3154)
  Trigger build
  Prevent navBar header background transition in modals, fixes black background in modals navBar
  Link to root of movieapp repo (wix#3112)
  Test [skip ci]
  Revert "Support a “modal” prop for tabbed iOS apps (wix#1578)"
  Revert "fix build issue"
  fix build issue
  fixed a bug modal viewController was not deallocated when to call dismissAllModals (wix#2843)
  Support a “modal” prop for tabbed iOS apps (wix#1578)
  Add iPad landscape launch image (wix#2473)
  Now passing an activity to clearHostOnActivityDestroy (wix#3133)
  Change CI var env to JENKINS_CI
  Avoid NPR in SET (wix#3115)
  Update README.md
  Update README.md
  ...
reimertz pushed a commit to mavencook/react-native-navigation that referenced this pull request Sep 14, 2018
- We do that in order to allow the end user to decide
wether they want to destroy the host based on who's
the one calling onDestroy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants