Last active
January 7, 2017 19:42
-
-
Save Diolor/5a5056388e0492bc3457486287695b65 to your computer and use it in GitHub Desktop.
Uncontrollable observable with commit()
This file contains 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 MainActivity extends AppCompatActivity { | |
private final Disposable disposable = Observable.timer(5, TimeUnit.SECONDS) | |
.subscribe(o -> | |
new MyDialogFragment() | |
.show(getSupportFragmentManager(), "DIALOG_TAG") | |
); | |
@Override | |
protected void onPause() { | |
super.onPause(); | |
} | |
@Override | |
protected void onSaveInstanceState(Bundle outState) { | |
super.onSaveInstanceState(outState); | |
} | |
@Override | |
protected void onStop() { | |
super.onStop(); | |
disposable.dispose(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment