2016-03-20 13 views
0

私は同期アプリケーションを開発しましたが、すべてうまくいっていますが、問題は1つだけです。Android同期アダプタが動作しない

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接点は、」それが返されます私はcontact.nameを呼び出す場合、私は例えばそれを呼び出すたびに虚偽の表示、動作しない偽

これは私が連絡先情報を送信する方法である

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)); 

そしてMyContactこの

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; 
} 

}

のように見えます

誰も私が

答えて

0

は私が行うために必要なすべてが

... 
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; 
} 
... 
私の文字列の名前を変更した解決することができますどのように任意のアイデアを持っています
関連する問題