Created
September 26, 2017 23:23
-
-
Save stephanenicolas/b120c0dcd9e92b39c52e814b93cc49ee to your computer and use it in GitHub Desktop.
The Lambda Way: setting the listener
This file contains hidden or 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 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