mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
Example code from Android, need to know WTF we actually return so I know what to build
This commit is contained in:
parent
9957dfca73
commit
b463b01573
30
src/com/phonegap/demo/ContactManager.java
Normal file
30
src/com/phonegap/demo/ContactManager.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.phonegap.demo;
|
||||
|
||||
import android.provider.Contacts.People;
|
||||
import android.content.ContentUris;
|
||||
import android.net.Uri;
|
||||
import android.database.Cursor;
|
||||
|
||||
public class ContactManager {
|
||||
|
||||
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);
|
||||
|
||||
} while (cur.moveToNext());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user