Android Syncadapter does not allow user to choose sync or not sync

I have read every volume of detail about syncadapters that exists and I understand how it is designed to work, but I cannot find any information on whether it is possible NOT to let the user not sync data.

For example, if I use sync to sync all of my data for my application to the server, obviously I don't want the user to be able to check "Do not sync data" from the accounts screen, so I want to know if there is a way to sync all this data with by the sync adapter, either by not being able to check the box in unsync, or by creating a hidden sync account that the user cannot change.

If using a sync adapter is the wrong context for this case, I would appreciate some examples of the best ways to implement what I need, or heading in the right direction. I think the use of syncadapter MAY is wrong and I might have to implement my own service, I just need an example or something to get me going in the right direction.

Thank you for your help.

+3


source to share


1 answer


I found a solution, there is a tag you can specify in the layout xml

Android: userVisible = "false"



this prevents the user from being able to turn off sync. Although there is still a bug in 2.3.3 that says the service is not syncing even though it is syncing. Most likely because the user doesn't select the checkbox.

+6


source







All Articles