Skip to content

Instantly share code, notes, and snippets.

@stephanenicolas
Created September 26, 2017 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephanenicolas/b120c0dcd9e92b39c52e814b93cc49ee to your computer and use it in GitHub Desktop.
Save stephanenicolas/b120c0dcd9e92b39c52e814b93cc49ee to your computer and use it in GitHub Desktop.
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