Code example for CursorAdapter

Methods: getActivity, getCursor

0
		private int[] mCellStates;
		private String mPreviousSection;
		private String mCurrentSection;
 
		public BuddiesAdapter(Context context) {
			super(context, null, false);
			mInflater = getActivity().getLayoutInflater();
			mCollator = java.text.Collator.getInstance();
			mCollator.setStrength(java.text.Collator.PRIMARY);
			mAlphabetIndexer = new AlphabetIndexer(getCursor(), BuddiesQuery.LASTNAME, alphabet);
		} 
 
		@Override 
		public Cursor swapCursor(Cursor newCursor) {
			mAlphabetIndexer.setCursor(newCursor);
			mCellStates = newCursor == null ? null : new int[newCursor.getCount()];
			return super.swapCursor(newCursor);
		} 
 
		@Override 
		public View newView(Context context, Cursor cursor, ViewGroup parent) {