Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is content provider where value of that check box is stored . </p> <p>@Override</p> <pre><code>public boolean [More ...] onPreferenceTreeClick(PreferenceScreen preferences, Preference preference) { if (preference instanceof SyncStateCheckBoxPreference) { SyncStateCheckBoxPreference syncPref = (SyncStateCheckBoxPreference) preference; String authority = syncPref.getAuthority(); Account account = syncPref.getAccount(); boolean syncAutomatically = ContentResolver.getSyncAutomatically(account, authority); if (syncPref.isOneTimeSyncMode()) { requestOrCancelSync(account, authority, true); } else { boolean syncOn = syncPref.isChecked(); boolean oldSyncState = syncAutomatically; if (syncOn != oldSyncState) { // if we're enabling sync, this will request a sync as well ContentResolver.setSyncAutomatically(account, authority, syncOn); // if the master sync switch is off, the request above will // get dropped. when the user clicks on this toggle, // we want to force the sync, however. if (!ContentResolver.getMasterSyncAutomatically() || !syncOn) { requestOrCancelSync(account, authority, syncOn); } } } </code></pre> <p>This something where you need to do some extra work. Settings always saves every value to shared preference . you need to find that value from shared preference and register for that shared preference change listener. I don't know is it possible to listen for that sync check box or not. </p> <p>Here is the link where u find that check box or switch preference where value are being saved. Analyze <a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.3_r2.1/com/android/settings/AccountPreference.java?av=f" rel="nofollow">First</a> <a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.3_r2.1/com/android/settings/accounts/SyncSettings.java?av=f" rel="nofollow">Second</a> links.</p> <p>One more thing to note is , settings code saves some value in this tables . </p> <p><strong><a href="http://developer.android.com/reference/android/provider/Settings.Global.html" rel="nofollow">First table</a></strong></p> <p><a href="http://developer.android.com/reference/android/provider/Settings.Secure.html" rel="nofollow"><strong>Second table</strong></a></p> <p><strong><a href="http://developer.android.com/reference/android/provider/Settings.System.html" rel="nofollow">Third table</a></strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload