Last active
December 16, 2017 13:22
-
-
Save PhilippeBoisney/8587f5f012600cd97fe01f95990c3e0d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainFragment extends Fragment { | |
... | |
// 1 - Create a disposable | |
private Disposable disposable; | |
@Override | |
public void onDestroy() { | |
// 2 - Unsubscribe | |
if (this.disposable != null) this.disposable.dispose(); | |
super.onDestroy(); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment