Skip to content

Instantly share code, notes, and snippets.

@stephanenicolas
Last active September 28, 2017 06:28
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/3df144a1be8aee7610c7a2e666a49e7f to your computer and use it in GitHub Desktop.
Save stephanenicolas/3df144a1be8aee7610c7a2e666a49e7f to your computer and use it in GitHub Desktop.
Invoke the listener method reference on the current activity
public class HeadLineFragment extends ListFragment {
@Override
public void onListItemClick(ListView l, View v, int p, long i) {
// Send the event to the host activity
// we should probably check if the activity is finishing|destroyed|rotating
mCallback.onArticleSelected(getActivity(), p);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment