Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder class for ScanRequest
.
Summary
Public constructors |
Creates a builder for a ScanRequest instance.
|
Public constructors
Builder
Builder()
Creates a builder for a ScanRequest
instance.
Public methods
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 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaRouter2.ScanRequest.Builder\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaRouter2.ScanRequest.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|-----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.MediaRouter2.ScanRequest.Builder](#) |\n\nBuilder class for [ScanRequest](/reference/kotlin/android/media/MediaRouter2.ScanRequest).\n\nSummary\n-------\n\n| Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder())`()` Creates a builder for a [ScanRequest](/reference/kotlin/android/media/MediaRouter2.ScanRequest) instance. |\n\n| Public methods ||\n|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [MediaRouter2.ScanRequest](/reference/kotlin/android/media/MediaRouter2.ScanRequest) | [build](#build())`()` Returns a new [ScanRequest](/reference/kotlin/android/media/MediaRouter2.ScanRequest) instance. |\n| [MediaRouter2.ScanRequest.Builder](#) | [setScreenOffScan](#setScreenOffScan(kotlin.Boolean))`(`isScreenOffScan:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether the app is requesting to scan even while the screen is off, bypassing default scanning restrictions. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nCreates a builder for a [ScanRequest](/reference/kotlin/android/media/MediaRouter2.ScanRequest) instance. \n**See Also**\n\n- [#requestScan(ScanRequest)](/reference/kotlin/android/media/MediaRouter2#requestScan(android.media.MediaRouter2.ScanRequest))\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): MediaRouter2.ScanRequest\n```\n\nReturns a new [ScanRequest](/reference/kotlin/android/media/MediaRouter2.ScanRequest) instance.\n\n| Return ||\n|--------------------------------------------------------------------------------------|------------------------------|\n| [MediaRouter2.ScanRequest](/reference/kotlin/android/media/MediaRouter2.ScanRequest) | This value cannot be `null`. |\n\n### setScreenOffScan\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setScreenOffScan(isScreenOffScan: Boolean): MediaRouter2.ScanRequest.Builder\n```\n\nSets whether the app is requesting to scan even while the screen is off, bypassing default scanning restrictions. Only apps holding [android.Manifest.permission#MEDIA_ROUTING_CONTROL](../Manifest.permission.html#MEDIA_ROUTING_CONTROL:kotlin.String) or [android.Manifest.permission#MEDIA_CONTENT_CONTROL](../Manifest.permission.html#MEDIA_CONTENT_CONTROL:kotlin.String) should set this to `true`.\n\n| Return ||\n|---------------------------------------|------------------------------|\n| [MediaRouter2.ScanRequest.Builder](#) | This value cannot be `null`. |\n\n**See Also**\n\n- [#requestScan(ScanRequest)](/reference/kotlin/android/media/MediaRouter2#requestScan(android.media.MediaRouter2.ScanRequest))"]]