I was interested to find out what is the best way to respond to a item click of a recycler view.
Normally I would add a onclick() listener to the ViewHolder and pass ba
Step 1: Move the business logic out of the activities to domain classes/services
Optional: Use https://github.com/roboguice/roboguice to easily wire up your services with each other.
Step 2: @Inject
(or just set) your service into your adapter
Step 3: Grab https://github.com/JakeWharton/RxBinding
and use the super powers in your adapter:
RxView.clicks(button).subscribe(new Action1() {
@Override
public void call(Void aVoid) {
myCoolService.doStuff();
}
});
Step 4: Get a runtime crash and learn how to deal with subscriptions
Step 5: PROFIT :)