Code example for AlphabetIndexer

0
		@Override 
		public Cursor swapCursor(Cursor c) {
			if (c != null) {
				alphaIndexer = new AlphabetIndexer(c,
						c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME),
						" ABCDEFGHIJKLMNOPQRSTUVWXYZ"); 
			} 
 
			return super.swapCursor(c);
		} 
		 
		@Override 
		public int getPositionForSection(int section) {
			return alphaIndexer.getPositionForSection(section);
		} 
 
		@Override 
		public int getSectionForPosition(int position) {
			return alphaIndexer.getSectionForPosition(position);
		}