Stay organized with collections
Save and categorize content based on your preferences.
CustomPrinterIconCallback
class CustomPrinterIconCallback
Callback for PrinterDiscoverySession.onRequestCustomPrinterIcon
.
Summary
Public methods |
Boolean |
Provide a new icon for a printer.
|
Public methods
onCustomPrinterIconLoaded
fun onCustomPrinterIconLoaded(icon: Icon?): Boolean
Provide a new icon for a printer. Can be called more than once to update the icon.
Parameters |
icon |
Icon?: The new icon for the printer or null to unset the current icon |
Return |
Boolean |
true iff the icon could be updated |
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,["# CustomPrinterIconCallback\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCustomPrinterIconCallback\n=========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/printservice/CustomPrinterIconCallback \"View this page in Java\") \n\n```\nclass CustomPrinterIconCallback\n```\n\n|---|-----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.printservice.CustomPrinterIconCallback](#) |\n\nCallback for [PrinterDiscoverySession.onRequestCustomPrinterIcon](/reference/kotlin/android/printservice/PrinterDiscoverySession#onRequestCustomPrinterIcon(android.print.PrinterId,%20android.os.CancellationSignal,%20android.printservice.CustomPrinterIconCallback)).\n\nSummary\n-------\n\n| Public methods ||\n|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onCustomPrinterIconLoaded](#onCustomPrinterIconLoaded(android.graphics.drawable.Icon))`(`icon:` `[Icon](../graphics/drawable/Icon.html#)?`)` Provide a new icon for a printer. |\n\nPublic methods\n--------------\n\n### onCustomPrinterIconLoaded\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun onCustomPrinterIconLoaded(icon: Icon?): Boolean\n```\n\nProvide a new icon for a printer. Can be called more than once to update the icon.\n\n| Parameters ||\n|--------|----------------------------------------------------------------------------------------------------------|\n| `icon` | [Icon](../graphics/drawable/Icon.html#)?: The new icon for the printer or null to unset the current icon |\n\n| Return ||\n|------------------------------------------------------------------------------------|------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true iff the icon could be updated |"]]