Android AccountManager and SyncManager implementation caused only Name field to appear in Add/Edit Contact screen

StackOverflow https://stackoverflow.com/questions/4953850

Question

We implemented Android's Account Manager and Sync Manager api to create contact sync. But when user selects our account while adding contact, it only displays Name fields and all other fields disappear.

Here is what I have in my manifest

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

This is what I have in my syncadapter.xml and authenticator.xml

<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
    android:contentAuthority="com.android.contacts"
    android:accountType="com.rahul.utility.contacts"
/>

Have seen people talk about this kind of issue while adding custom fields that it is a bug in Contact application. I also checked out the code of Exchange Email client in Android source code and they seems to be doing exactly same as what I did, but still when you select Add Contact for an Exchange account it shows up all the fields in the contact.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top