SyncAdapter android:userVisible attribute not working

拟墨画扇 提交于 2019-12-12 12:20:12

问题


According to the android Documentation

android:userVisible defaults to true and controls whether or not this sync adapter shows up in the Sync Settings screen.

but it shows in the Settings whatever value it gets!

EDIT Nov 03 2014

I removed android:icon android:label android:smallIcon from authenticator.xml and now it's not showing in the Accounts but there is an empty entry on Add Account tested on Samsung Galaxy S4. And for the record this totally crashed my 2.3.3 emulator when opening Accounts from Settings.


回答1:


I have implemented my own syncadapter it's working for me as below :

Case 1: When android:userVisible="false" There is only app icon,Account name and app title

<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
              android:contentAuthority="com.example.kukssyncadapter"
              android:accountType="com.example.kukssyncadapter"
               android:supportsUploading="false"
              android:allowParallelSyncs="false"
          android:userVisible="false" 
        />  

Case 2: When android:userVisible="true" There is app icon,Account name and app title with sync control functionality as you can see from image

<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
              android:contentAuthority="com.example.kukssyncadapter"
              android:accountType="com.example.kukssyncadapter"
               android:supportsUploading="false"
              android:allowParallelSyncs="false"
          android:userVisible="true" 
        />   



来源:https://stackoverflow.com/questions/25960240/syncadapter-androiduservisible-attribute-not-working

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