Code example for CursorAdapter

Methods: getItemId

0
	public void onListItemClick(final ListView l, final View v,
			final int position, final long id)
	{ 
		final Intent detailsIntent = new Intent(getActivity(),
				EventDetailsFragment.class); 
		detailsIntent.putExtra("eventId", adapter.getItemId(position));
		startActivity(detailsIntent);
	} 
 
	@Override 
	public void onLoaderReset(final Loader<Cursor> loader)
	{ 
		adapter.swapCursor(null);
	} 
 
	@Override 
	public void onLoadFinished(final Loader<Cursor> loader, final Cursor data)
	{ 
		adapter.swapCursor(data);
		if (data.getCount() == 0)
			setEmptyText(getText(R.string.agenda_empty));