Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder for PreapprovalDetails
Summary
Public constructors |
Creates a new Builder.
|
Public constructors
Builder
Builder()
Creates a new Builder.
Public methods
setLocale
fun setLocale(value: ULocale): PackageInstaller.PreapprovalDetails.Builder
The locale is used to get the app label from the APKs (includes the base APK and split APKs) related to the package to be installed. The caller needs to make sure the app label is consistent with the app label of PreapprovalDetails
when validating the installation. Otherwise, the pre-approval install session will fail.
Parameters |
value |
ULocale: This value cannot be null . |
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,["# PackageInstaller.PreapprovalDetails.Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/content/pm/PackageInstaller.PreapprovalDetails.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.content.pm.PackageInstaller.PreapprovalDetails.Builder](#) |\n\nA builder for [PreapprovalDetails](/reference/kotlin/android/content/pm/PackageInstaller.PreapprovalDetails)\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------|---|\n| [Builder](#Builder())`()` Creates a new Builder. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [PackageInstaller.PreapprovalDetails](/reference/kotlin/android/content/pm/PackageInstaller.PreapprovalDetails) | [build](#build())`()` Builds the instance. |\n| [PackageInstaller.PreapprovalDetails.Builder](#) | [setIcon](#setIcon(android.graphics.Bitmap))`(`value:` `[Bitmap](../../graphics/Bitmap.html#)`)` The icon representing the app to be installed. |\n| [PackageInstaller.PreapprovalDetails.Builder](#) | [setLabel](#setLabel(kotlin.CharSequence))`(`value:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)`)` The label representing the app to be installed. |\n| [PackageInstaller.PreapprovalDetails.Builder](#) | [setLocale](#setLocale(android.icu.util.ULocale))`(`value:` `[ULocale](../../icu/util/ULocale.html#)`)` The locale is used to get the app label from the APKs (includes the base APK and split APKs) related to the package to be installed. |\n| [PackageInstaller.PreapprovalDetails.Builder](#) | [setPackageName](#setPackageName(kotlin.String))`(`value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` The package name of the app to be installed. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nCreates a new Builder.\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): PackageInstaller.PreapprovalDetails\n```\n\nBuilds the instance. This builder should not be touched after calling this!\n\n| Return ||\n|-----------------------------------------------------------------------------------------------------------------|------------------------------|\n| [PackageInstaller.PreapprovalDetails](/reference/kotlin/android/content/pm/PackageInstaller.PreapprovalDetails) | This value cannot be `null`. |\n\n### setIcon\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setIcon(value: Bitmap): PackageInstaller.PreapprovalDetails.Builder\n```\n\nThe icon representing the app to be installed.\n\n| Parameters ||\n|---------|---------------------------------------------------------------------|\n| `value` | [Bitmap](../../graphics/Bitmap.html#): This value cannot be `null`. |\n\n| Return ||\n|--------------------------------------------------|------------------------------|\n| [PackageInstaller.PreapprovalDetails.Builder](#) | This value cannot be `null`. |\n\n### setLabel\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setLabel(value: CharSequence): PackageInstaller.PreapprovalDetails.Builder\n```\n\nThe label representing the app to be installed.\n\n| Parameters ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------|\n| `value` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): This value cannot be `null`. |\n\n| Return ||\n|--------------------------------------------------|------------------------------|\n| [PackageInstaller.PreapprovalDetails.Builder](#) | This value cannot be `null`. |\n\n### setLocale\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setLocale(value: ULocale): PackageInstaller.PreapprovalDetails.Builder\n```\n\nThe locale is used to get the app label from the APKs (includes the base APK and split APKs) related to the package to be installed. The caller needs to make sure the app label is consistent with the app label of [PreapprovalDetails](/reference/kotlin/android/content/pm/PackageInstaller.PreapprovalDetails) when validating the installation. Otherwise, the pre-approval install session will fail.\n\n| Parameters ||\n|---------|-----------------------------------------------------------------------|\n| `value` | [ULocale](../../icu/util/ULocale.html#): This value cannot be `null`. |\n\n| Return ||\n|--------------------------------------------------|------------------------------|\n| [PackageInstaller.PreapprovalDetails.Builder](#) | This value cannot be `null`. |\n\n### setPackageName\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setPackageName(value: String): PackageInstaller.PreapprovalDetails.Builder\n```\n\nThe package name of the app to be installed.\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------------------------------------------|\n| `value` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |\n\n| Return ||\n|--------------------------------------------------|------------------------------|\n| [PackageInstaller.PreapprovalDetails.Builder](#) | This value cannot be `null`. |"]]