Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The Lambda Way: setting the listener
public static class MainActivity extends Activity {
public void bindFragment(HeadlinesFragment fragment) {
fragment.setHeadlineListener(MainActivity::onArticleSelected);
}
public void onArticleSelected(int position) {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment