Code example for AsyncQueryHandler

Methods: startQuery

0
    } 
 
    private void asyncQueryContact() { 
        Uri uri = Uri.parse("content://com.android.contacts/data/phones");  
        String[] projection = { "_id", "display_name", "data1", "sort_key" };  
        asyncQuery.startQuery(0, null, uri, projection, null, null,"sort_key COLLATE LOCALIZED asc");
	} 
 
 
	private class MyAsyncQueryHandler extends AsyncQueryHandler {  
   
        public MyAsyncQueryHandler(ContentResolver cr) {  
            super(cr);  
   
        }   
   
        @Override   
        protected void onQueryComplete(int token, Object cookie, Cursor cursor) {  
            if (cursor != null && cursor.getCount() > 0) {  
            	listData = new ArrayList<ContentValues>();  
                //cursor.moveToFirst();