Udostępnij za pośrednictwem


AbstractThreadedSyncAdapter.OnUnsyncableAccount Method

Definition

Allows to defer syncing until all accounts are properly set up.

[Android.Runtime.Register("onUnsyncableAccount", "()Z", "GetOnUnsyncableAccountHandler", ApiSince=28)]
public virtual bool OnUnsyncableAccount ();
[<Android.Runtime.Register("onUnsyncableAccount", "()Z", "GetOnUnsyncableAccountHandler", ApiSince=28)>]
abstract member OnUnsyncableAccount : unit -> bool
override this.OnUnsyncableAccount : unit -> bool

Returns

If false syncing is deferred. Returns true by default, i.e. by default syncing starts immediately.

Attributes

Remarks

Allows to defer syncing until all accounts are properly set up.

Called when a account / authority pair <ul> <li>that can be handled by this adapter</li> <li>ContentResolver#requestSync(SyncRequest) is synced</li> <li>and the account/provider ContentResolver#getIsSyncable(Account, String) has unknown state (<0).</li> </ul>

This might be called on a different service connection as #onPerformSync.

The system expects this method to immediately return. If the call stalls the system behaves as if this method returned true. If it is required to perform a longer task (such as interacting with the user), return false and proceed in a difference context, such as an android.app.Activity, or foreground service. The sync can then be rescheduled once the account becomes syncable.

Java documentation for android.content.AbstractThreadedSyncAdapter.onUnsyncableAccount().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to