Code example for SimpleCursorAdapter

Methods: getItem

0
			return 2; 
		} 
 
		@Override 
		public int getItemViewType(int position) {
			final Cursor c = (Cursor) getItem(position);
			// If the id is invalid, it's a header 
			if (c.getLong(0) < 1) {
				return headerType;
			} 
			else { 
				return itemType;
			} 
		} 
 
		@Override 
		public View getView(int position, View convertView, ViewGroup parent) {
			if (convertView == null) {
				final LayoutInflater inflater = LayoutInflater.from(mContext);
				convertView = inflater.inflate(getViewLayout(position), parent,
						false);