Created
December 22, 2015 18:54
-
-
Save subodh-malgonde/6553ee25ac338771a17d to your computer and use it in GitHub Desktop.
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
@Override | |
public void onCreate(Bundle savedInstanceState){ | |
super.onCreate(savedInstanceState); | |
//register with the event bus | |
EventBus.getDefault().register(this); | |
// other code goes here | |
} | |
@Override | |
public void onDestroy(){ | |
super.onDestroy(); | |
//unregister from the event bus | |
EventBus.getDefault().unregister(this); | |
} | |
//Subscribe to the AddToCartEvent | |
public void onEvent(AddToCartEvent event){ | |
Product product = event.getProduct(); | |
//use this Product instance to update your UI | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment