Skip to content

Instantly share code, notes, and snippets.

@pszklarska
Last active June 17, 2017 15:33
Show Gist options
  • Save pszklarska/ff69425c6eb716039aafe4e1b1980dbf to your computer and use it in GitHub Desktop.
Save pszklarska/ff69425c6eb716039aafe4e1b1980dbf to your computer and use it in GitHub Desktop.
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