Cursor cursor = managedQuery(Phone.CONTENT_URI,new String[] { Phone.DISPLAY_NAME, Phone.NUMBER }, Phone.NUMBER + "= ?", new String[]{address},Phone.DISPLAY_NAME+" ASC");
cursor.moveToFirst();
String name=cursor.getString(cursor.getColumnIndex(Phone.DISPLAY_NAME));
the line with the code ‘cursor.getColumnIndex(Phone.DISPLAY)’ is giving me an error on the phone but not on the emulator.. Can you please tell me can this this happen?? Infact I have used this line in 3 different places.. It works at 2 places and not in 1 place
try this links
http://www.higherpass.com/Android/Tutorials/Working-With-Android-Contacts/