Skip to content

Instantly share code, notes, and snippets.

@JoseAlcerreca
Last active September 13, 2017 14:15
Show Gist options
  • Save JoseAlcerreca/2a9e8f21ff126cfb3b9667d2cb2dea4a to your computer and use it in GitHub Desktop.
Save JoseAlcerreca/2a9e8f21ff126cfb3b9667d2cb2dea4a to your computer and use it in GitHub Desktop.
public class MyLiveData extends LiveData<MyData> {
public MyLiveData(Context context) {
// Initialize service
}
@Override
protected void onActive() {
// Start listening
}
@Override
protected void onInactive() {
// Stop listening
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment