Android Wie lese ich Android-Kontakte und SIM-Kontakte?Android

Forum für diejenigen, die für Android programmieren
Anonymous
 Android Wie lese ich Android-Kontakte und SIM-Kontakte?

Post by Anonymous »

Ich erhalte derzeit schreibgeschützte Android-Kontakte. Unten ist der Code, den ich verwende:

Code: Select all

String[] projecao = new String[] { Contacts._ID,
Contacts.LOOKUP_KEY, Contacts.DISPLAY_NAME };
String selecao = Contacts.HAS_PHONE_NUMBER + " = 1";
Cursor contatos = contexto.getContentResolver().query(
ContactsContract.Contacts.CONTENT_URI, projecao, selecao, null, null);
Und um die Telefonnummer zu erhalten:

Code: Select all

Cursor phones = contexto.getContentResolver().query(
Phone.CONTENT_URI,
new String[] { Phone.NUMBER },
Phone.CONTACT_ID + " = ?",
new String[] { contatos.getString(contatos
.getColumnIndex(Contacts._ID)) }, null);
Ich möchte eine Datenbank aller Kontakte mit Nummern verwalten.

Was muss ich tun, um auch SIM-Karten-Kontakte zu erhalten?

Vielen Dank für Ihre Zeit.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post