2016-03-20 28 views
0

Bir senkronizasyon uygulaması geliştirdim, her şey yolunda ama sadece bir sorun var.Android Sync Bağdaştırıcısı çalışmıyor

public static void addContact(Context context, MyContact contact) { 
    ContentResolver resolver = context.getContentResolver(); 
    resolver.delete(RawContacts.CONTENT_URI, RawContacts.ACCOUNT_TYPE + " = ?", new String[]{AccountGeneral.ACCOUNT_TYPE}); 

"MyContact temas" o dönecektir i contact.name ararsanız ben mesela diyoruz her zaman yanlış görüntüler çalışmıyor yanlış

bu I İletişim bilgileri göndermek nasıl

for (int i = 0; i < mtcontacts.length(); i++) { 
           JSONObject mycontacts = mtcontacts.getJSONObject(i); 
           String name = mycontacts.getString("name"); 
           String id = mycontacts.getString("id"); 
           String email = mycontacts.getString("email"); 
           String company = mycontacts.getString("company"); 
           String job = mycontacts.getString("job"); 
           String phone = mycontacts.getString("phone"); 
           String fax = mycontacts.getString("fax"); 
           String mobile = mycontacts.getString("mobile"); 
           String website = mycontacts.getString("website"); 
           String address = mycontacts.getString("street"); 

           ContactsManager.addContact(NewActivity.this, new MyContact(name, email, mobile, company, job, phone, fax, website, address)); 

Ve MyContact bu

public String name; 
public String email; 
public String company; 
public String job; 
public String mobile; 
public String phone; 
public String website; 
public String address; 
public String fax; 
public long id; 

public MyContact(String address, String email, String mobile, String company, String job, String phone, String fax, String website, String name) { 
    this.name = name; 
    this.phone = phone; 
    this.email = email; 
    this.address = address; 
    this.website = website; 
    this.job = job; 
    this.company = company; 
    this.mobile = mobile; 
    this.fax = fax; 
} 

}

benziyor

kimse ben çözüldü i yapmak için gerekli tüm

cevap

0

hale nasıl bir fikrin var mı benim Strings adlandırmak oldu

... 
public String name; 
public String email; 
public String phone; 

public MyContact(String address1, String email1, String name1) { 
this.name = name1; 
this.phone = phone1; 
this.email = email1; 
} 
... 
İlgili konular