Skip to content

Instantly share code, notes, and snippets.

@skatldjs
Created October 22, 2010 05:00
Show Gist options
  • Select an option

  • Save skatldjs/639961 to your computer and use it in GitHub Desktop.

Select an option

Save skatldjs/639961 to your computer and use it in GitHub Desktop.
import android.provider.Contacts.People;
private void getColumnData(Cursor cur){
if (cur.moveToFirst()) {
String name;
String phoneNumber;
int nameColumn = cur.getColumnIndex(People.NAME);
int phoneColumn = cur.getColumnIndex(People.NUMBER);
String imagePath;
do {
// Get the field values
name = cur.getString(nameColumn);
phoneNumber = cur.getString(phoneColumn);
// Do something with the values.
...
} while (cur.moveToNext());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment