Code example for CursorAdapter

Methods: getItem

0
        CheckInDialogFragment f = CheckInDialogFragment.newInstance(getActivity(), episodeTvdbId);
        f.show(getFragmentManager(), "checkin-dialog");
    } 
 
    private void onFlagEpisodeWatched(AdapterContextMenuInfo info, boolean isWatched) {
        Cursor item = (Cursor) mAdapter.getItem(info.position);
 
        new FlagTask(getActivity(), item.getInt(UpcomingQuery.REF_SHOW_ID))
                .episodeWatched((int) info.id, item.getInt(UpcomingQuery.SEASON),
                        item.getInt(UpcomingQuery.NUMBER), isWatched)
                .execute(); 
    } 
 
    @Override 
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        int episodeId = (int) id;
 
        if (mDualPane) {
            // Check if fragment is shown, create new if needed. 
            EpisodeDetailsFragment detailsFragment = (EpisodeDetailsFragment) getFragmentManager()
                    .findFragmentById(R.id.fragment_details);