Hide dummy Account for Sync Adapter from Settings

女生的网名这么多〃 提交于 2019-11-29 21:28:44

I found the solution. This is how authenticator.xml should look like:

<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
                   android:accountType="net.astagor.android.hhp.account"

    />

You must not have these lines:

               android:icon="@drawable/ic_launcher"
               android:smallIcon="@drawable/ic_launcher"
               android:label="@string/app_name"

If you put them, the account will be visible wherever you set android:userVisible="false" or not.

This isn't a real answer, but if you remove the label from the authenticator.xml , it does not show in the list of added accounts , but the icon is there with no label in the list after clicking add account. Ugly and probably not a good idea. (this method does hide account at least on my nexus 4 running 4.4 - haven't checked other devices yet).

I believe the user visible flag in sync adapter only affects the display of the sync part after selecting an account, where you can see the last sync time, set auto sync settings, and trigger sync.

I'd love to know this also. It must be possible, as I don't see my accounts list littered with dummy accounts. So either there's a way or almost none of my installed apps are bothering with sync adapters?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!