Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Fix bug where onDetach is called before onAttach #66

Merged
merged 1 commit into from
May 2, 2016

Conversation

itspbj
Copy link
Contributor

@itspbj itspbj commented May 2, 2016

No description provided.

@itspbj itspbj added the bug label May 2, 2016
}

private class StateListeningViewController extends ViewController {
private String variable = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itspbj call this MockViewController. Use public fields instead private

@itspbj itspbj force-pushed the view-controller-attach-detach-bug branch from fb57f92 to 835370a Compare May 2, 2016 20:49

@Override
public void onAttach() {
variable = TEST_RESULT;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itspbj what this varialbe is used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lexer Simulate a variable being used in onDetach that was initialized in onAttach. In our code this throws an NPE in some cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itspbj ok

@lexer
Copy link
Contributor

lexer commented May 2, 2016

@itspbj 👍

@itspbj itspbj merged commit 6d8310d into master May 2, 2016
@itspbj itspbj deleted the view-controller-attach-detach-bug branch May 2, 2016 22:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants