BroadcastOptions.ToBundle 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.
Returns the created options as a Bundle, which can be passed to
android.content.Context#sendBroadcast(android.content.Intent)
Context.sendBroadcast(Intent) and related methods.
[Android.Runtime.Register("toBundle", "()Landroid/os/Bundle;", "GetToBundleHandler", ApiSince=34)]
public virtual Android.OS.Bundle ToBundle();
[<Android.Runtime.Register("toBundle", "()Landroid/os/Bundle;", "GetToBundleHandler", ApiSince=34)>]
abstract member ToBundle : unit -> Android.OS.Bundle
override this.ToBundle : unit -> Android.OS.Bundle
Returns
This value cannot be null.
- Attributes
Remarks
Returns the created options as a Bundle, which can be passed to Context.sendBroadcast(Intent) and related methods. Note that the returned Bundle is still owned by the BroadcastOptions object; you must not modify it, but can supply it to the sendBroadcast methods that take an options Bundle.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-08-03 UTC.
Throws: IllegalStateException if the broadcast option values are inconsistent. For example, if the delivery group policy is specified as "MERGED" but no extras merger is supplied.
Android reference for android.app.BroadcastOptions.toBundle.
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.