Last active
September 27, 2017 00:01
-
-
Save stephanenicolas/668f8dd9ceaf8239fb5556d5320ff651 to your computer and use it in GitHub Desktop.
Lambda Way: HeadlinesFragment
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 HeadlinesFragment extends ListFragment { | |
HeadlineListener mCallback; | |
public <T> void setHeadlineListener(HeadlineListener<T> listener) { | |
this.mCallBack = listener; | |
} | |
@Override | |
public void onListItemClick(ListView l, View v, int p, long i) { | |
// Send the event to the host activity | |
mCallback.onArticleSelected(getActivity(), p); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment