Code example for CursorAdapter

0
    private class DetailsAdapter extends CursorAdapter {
 
        private LayoutInflater mLayoutInflater;
 
        public DetailsAdapter(Context context, Cursor c, int flags) {
            super(context, c, flags);
 
            mLayoutInflater = (LayoutInflater) context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        } 
 
        @Override 
        public View newView(Context context, Cursor cursor, ViewGroup parent) {
            return mLayoutInflater.inflate(R.layout.episodedetails, parent, false);
        } 
 
        @Override 
        public void bindView(View view, Context context, Cursor cursor) {
            mShowId = cursor.getInt(DetailsQuery.REF_SHOW_ID); 
            mSeasonNumber = cursor.getInt(DetailsQuery.SEASON); 
            mEpisodeNumber = cursor.getInt(DetailsQuery.NUMBER);