SyncRequest.Builder.SetExtras(Bundle) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Developer-provided extras handed back when sync actually occurs. This bundle is copied into the SyncRequest returned by build() . Example: String[] syncItems = {"dog", "cat", "frog", "child"}; SyncRequest.Builder builder = new SyncRequest.Builder() .setSyncAdapter(dummyAccount, dummyProvider) .syncOnce(); for (String syncData : syncItems) { Bundle extras = new Bundle(); extras.setString("data", syncData); builder.setExtras(extras); ContentResolver.sync(builder.build()); // Each sync() request creates a unique sync. } Only values of the following types may be used in the extras bundle: Integer Long Boolean Float Double String Account null If any data is present in the bundle not of this type, build() will throw a runtime exception.
[Android.Runtime.Register("setExtras", "(Landroid/os/Bundle;)Landroid/content/SyncRequest$Builder;", "GetSetExtras_Landroid_os_Bundle_Handler")]
public virtual Android.Content.SyncRequest.Builder? SetExtras(Android.OS.Bundle? bundle);
[<Android.Runtime.Register("setExtras", "(Landroid/os/Bundle;)Landroid/content/SyncRequest$Builder;", "GetSetExtras_Landroid_os_Bundle_Handler")>]
abstract member SetExtras : Android.OS.Bundle -> Android.Content.SyncRequest.Builder
override this.SetExtras : Android.OS.Bundle -> Android.Content.SyncRequest.Builder
Parameters
- bundle
- Bundle
extras bundle to set.
Returns
Developer-provided extras handed back when sync actually occurs. This bundle is copied into the SyncRequest returned by build() . Example: String[] syncItems = {"dog", "cat", "frog", "child"}; SyncRequest.Builder builder = new SyncRequest.Builder() .setSyncAdapter(dummyAccount, dummyProvider) .syncOnce(); for (String syncData : syncItems) { Bundle extras = new Bundle(); extras.setString("data", syncData); builder.setExtras(extras); ContentResolver.sync(builder.build()); // Each sync() request creates a unique sync. } Only values of the following types may be used in the extras bundle: Integer Long Boolean Float Double String Account null If any data is present in the bundle not of this type, build() will throw a runtime exception.
- Attributes
Remarks
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.
Java documentation for android.content.SyncRequest.Builder.setExtras(android.os.Bundle).