Instantly share code, notes, and snippets.

Embed
What would you like to do?
Lambda Way: HeadlinesFragment
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