Last active
December 24, 2015 07:56
-
-
Save subodh-malgonde/0ce2f78fdddaaa1e9fb7 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
public class MyDatabaseHelper{ | |
public MyDatabaseHelper(){ | |
EventBus.getDefault().register(this); | |
} | |
// To register an async event handler you need to define onEventAsync or onEventBackgroundThread | |
// Here we will use onEventBackgroundThread, please check EventBus' docs for more details. | |
public void onEventBackgroundThread(AddToCartEvent event){ | |
Product product = event.getProduct(); | |
//use this Product instance to update your databse | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment