Content Provider and People.ContactMethods.DATA

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Content Provider and People.ContactMethods.DATA

Postby kidotai » Wed Dec 16, 2009 2:58 pm

how to differentiate between "email address" and "postal address"?


try{
String[] columns = new String[] {
People.ContactMethods.DATA,
People.ContactMethods.KIND,
People.ContactMethods.TYPE };

Uri emailUri = Uri.withAppendedPath(People.CONTENT_URI, String.valueOf(idContact));
emailUri = Uri.withAppendedPath(emailUri, People.ContactMethods.CONTENT_DIRECTORY);;

Cursor cur = managedQuery(emailUri,columns,null,null,null);

if (cur.moveToFirst()) {
do {
int tipoMail = cur.getInt(cur.getColumnIndex(People.ContactMethods.TYPE));
int kind = cur.getInt(cur.getColumnIndex(People.ContactMethods.KIND));
String streMail = cur.getString(cur.getColumnIndex(People.ContactMethods.DATA));

} while (cur.moveToNext());
}

}
catch(Exception ex){
Log.e("ContactsManager", "GetEmailAddress", ex);
}


thank all
kidotai
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Dec 16, 2009 1:53 pm

Top

Postby Sullen » Thu Dec 17, 2009 8:15 am

Try to use [url=http://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.html]ContactsContract.CommonDataKinds
[/url] in order to get appropriate data.
Sullen
Freshman
Freshman
 
Posts: 2
Joined: Wed Dec 16, 2009 2:18 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 5 guests