Stay organized with collections
Save and categorize content based on your preferences.
ViewBinder
interface ViewBinder
This class can be used by external clients of SimpleAdapter to bind values to views. You should use this class to bind values to views that are not directly supported by SimpleAdapter or to change the way binding occurs for views supported by SimpleAdapter.
Summary
Public methods |
abstract Boolean |
Binds the specified data to the specified view.
|
Public methods
setViewValue
abstract fun setViewValue(
view: View!,
data: Any!,
textRepresentation: String!
): Boolean
Binds the specified data to the specified view. When binding is handled by this ViewBinder, this method must return true. If this method returns false, SimpleAdapter will attempts to handle the binding on its own.
Parameters |
view |
View!: the view to bind the data to |
data |
Any!: the data to bind to the view |
textRepresentation |
String!: a safe String representation of the supplied data: it is either the result of data.toString() or an empty String but it is never null |
Return |
Boolean |
true if the data was bound to the view, false otherwise |
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,["# SimpleAdapter.ViewBinder\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nViewBinder\n==========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/widget/SimpleAdapter.ViewBinder \"View this page in Java\") \n\n```\ninterface ViewBinder\n```\n\n|----------------------------------------------|\n| [android.widget.SimpleAdapter.ViewBinder](#) |\n\nThis class can be used by external clients of SimpleAdapter to bind values to views. You should use this class to bind values to views that are not directly supported by SimpleAdapter or to change the way binding occurs for views supported by SimpleAdapter.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [setViewValue](#setViewValue(android.view.View,%20kotlin.Any,%20kotlin.String))`(`view:` `[View](../view/View.html#)!`, `data:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!`, `textRepresentation:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Binds the specified data to the specified view. |\n\nPublic methods\n--------------\n\n### setViewValue\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun setViewValue(\n view: View!, \n data: Any!, \n textRepresentation: String!\n): Boolean\n```\n\nBinds the specified data to the specified view. When binding is handled by this ViewBinder, this method must return true. If this method returns false, SimpleAdapter will attempts to handle the binding on its own.\n\n| Parameters ||\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `view` | [View](../view/View.html#)!: the view to bind the data to |\n| `data` | [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!: the data to bind to the view |\n| `textRepresentation` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: a safe String representation of the supplied data: it is either the result of data.toString() or an empty String but it is never null |\n\n| Return ||\n|------------------------------------------------------------------------------------|---------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if the data was bound to the view, false otherwise |"]]