Last active
June 17, 2017 15:33
-
-
Save pszklarska/ff69425c6eb716039aafe4e1b1980dbf 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
package pl.pszklarska.leakexample; | |
public class RxJavaLeakActivity extends AppCompatActivity { | |
private Subscription pokemonSubscription; | |
@Override | |
protected void onCreate(@Nullable final Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
pokemonSubscription = PokemonApi.getAllPokemons() | |
.repeatWhen(observable -> observable.delay(30, TimeUnit.MINUTES)) | |
.subscribe(this::doSomething); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment