0

I have created my own sync adapter . And I want to enable manual sync on it so that user can syn when they want . But the manual sync button is not showing .

enter image description here

As we can see that that there is a sync button on the left of checkbox , but in my case sync button is missing .

Here is my code for sync adapter

<?xml version="1.0" encoding="utf-8"?>
<sync-adapter
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:contentAuthority="com.ex.MyApplication"
    android:accountType="com.ex.MyApplication"
    android:userVisible="true"
    android:supportsUploading="true"
    android:allowParallelSyncs="true"
    android:isAlwaysSyncable="true"/>

Here is my code for authentication account

<?xml version="1.0" encoding="utf-8"?>
<account-authenticator
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:accountType="com.ex.MyApplication"
    android:icon="@drawable/ic_running"
    android:smallIcon="@drawable/ic_running"
    android:label="@string/app_name"/>

What did I miss ?

4

1 回答 1

0

如文档中所述,您可以在应用程序的任何位置提供手动同步选项。您必须通过带有 SYNC_EXTRAS_MANUAL 或 SYNC_EXTRAS_EXPEDITED 标志的捆绑包

https://developer.android.com/training/sync-adapters/running-sync-adapter.html#RunOnDemand

于 2015-10-04T08:55:43.360 回答