連絡先の同期を作成するために、Androidのアカウントマネージャーと同期マネージャーAPIを実装しました。ただし、ユーザーが連絡先を追加するときにアカウントを選択すると、[名前]フィールドのみが表示され、他のすべてのフィールドは表示されなくなります。
これが私のマニフェストにあるものです
<activity android:name=".AuthenticatorActivity" android:label="iAnywhere Login"
android:theme="@android:style/Theme.Dialog"
android:excludeFromRecents="true"></activity>
<service android:name=".accounts.AuthenticationService">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator"></action>
</intent-filter>
<meta-data android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator">
</meta-data>
</service>
<service
android:name=".accounts.SyncService"
android:exported="true">
<intent-filter>
<action
android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter" />
</service>
これは、syncadapter.xmlとauthenticator.xmlにあるものです。
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
android:contentAuthority="com.android.contacts"
android:accountType="com.rahul.utility.contacts"
/>
Contactアプリケーションのバグであるカスタムフィールドを追加しているときに、この種の問題について人々が話しているのを見たことがあります。また、AndroidソースコードでExchangeメールクライアントのコードを確認したところ、まったく同じように動作しているようですが、Exchangeアカウントで[連絡先の追加]を選択すると、連絡先のすべてのフィールドが表示されます。