Stay organized with collections
Save and categorize content based on your preferences.
OnSeekBarChangeListener
interface OnSeekBarChangeListener
A callback that notifies clients when the progress level has been changed. This includes changes that were initiated by the user through a touch gesture or arrow key/trackball as well as changes that were initiated programmatically.
Summary
Public methods |
abstract Unit |
Notification that the progress level has changed.
|
abstract Unit |
Notification that the user has started a touch gesture.
|
abstract Unit |
Notification that the user has finished a touch gesture.
|
Public methods
onProgressChanged
abstract fun onProgressChanged(
seekBar: SeekBar!,
progress: Int,
fromUser: Boolean
): Unit
Notification that the progress level has changed. Clients can use the fromUser parameter to distinguish user-initiated changes from those that occurred programmatically.
Parameters |
seekBar |
SeekBar!: The SeekBar whose progress has changed |
progress |
Int: The current progress level. This will be in the range min..max where min and max were set by ProgressBar.setMin(int) and ProgressBar.setMax(int) , respectively. (The default values for min is 0 and max is 100.) |
fromUser |
Boolean: True if the progress change was initiated by the user. |
onStartTrackingTouch
abstract fun onStartTrackingTouch(seekBar: SeekBar!): Unit
Notification that the user has started a touch gesture. Clients may want to use this to disable advancing the seekbar.
Parameters |
seekBar |
SeekBar!: The SeekBar in which the touch gesture began |
onStopTrackingTouch
abstract fun onStopTrackingTouch(seekBar: SeekBar!): Unit
Notification that the user has finished a touch gesture. Clients may want to use this to re-enable advancing the seekbar.
Parameters |
seekBar |
SeekBar!: The SeekBar in which the touch gesture began |
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,["# SeekBar.OnSeekBarChangeListener\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnSeekBarChangeListener\n=======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/widget/SeekBar.OnSeekBarChangeListener \"View this page in Java\") \n\n```\ninterface OnSeekBarChangeListener\n```\n\n|-----------------------------------------------------|\n| [android.widget.SeekBar.OnSeekBarChangeListener](#) |\n\nA callback that notifies clients when the progress level has been changed. This includes changes that were initiated by the user through a touch gesture or arrow key/trackball as well as changes that were initiated programmatically.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onProgressChanged](#onProgressChanged(android.widget.SeekBar,%20kotlin.Int,%20kotlin.Boolean))`(`seekBar:` `[SeekBar](/reference/kotlin/android/widget/SeekBar)!`, `progress:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `fromUser:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Notification that the progress level has changed. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStartTrackingTouch](#onStartTrackingTouch(android.widget.SeekBar))`(`seekBar:` `[SeekBar](/reference/kotlin/android/widget/SeekBar)!`)` Notification that the user has started a touch gesture. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStopTrackingTouch](#onStopTrackingTouch(android.widget.SeekBar))`(`seekBar:` `[SeekBar](/reference/kotlin/android/widget/SeekBar)!`)` Notification that the user has finished a touch gesture. |\n\nPublic methods\n--------------\n\n### onProgressChanged\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onProgressChanged(\n seekBar: SeekBar!, \n progress: Int, \n fromUser: Boolean\n): Unit\n```\n\nNotification that the progress level has changed. Clients can use the fromUser parameter to distinguish user-initiated changes from those that occurred programmatically.\n\n| Parameters ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `seekBar` | [SeekBar](/reference/kotlin/android/widget/SeekBar)!: The SeekBar whose progress has changed |\n| `progress` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The current progress level. This will be in the range min..max where min and max were set by [ProgressBar.setMin(int)](/reference/kotlin/android/widget/ProgressBar#setMin(kotlin.Int)) and [ProgressBar.setMax(int)](/reference/kotlin/android/widget/ProgressBar#setMax(kotlin.Int)), respectively. (The default values for min is 0 and max is 100.) |\n| `fromUser` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): True if the progress change was initiated by the user. |\n\n### onStartTrackingTouch\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onStartTrackingTouch(seekBar: SeekBar!): Unit\n```\n\nNotification that the user has started a touch gesture. Clients may want to use this to disable advancing the seekbar.\n\n| Parameters ||\n|-----------|----------------------------------------------------------------------------------------------------|\n| `seekBar` | [SeekBar](/reference/kotlin/android/widget/SeekBar)!: The SeekBar in which the touch gesture began |\n\n### onStopTrackingTouch\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onStopTrackingTouch(seekBar: SeekBar!): Unit\n```\n\nNotification that the user has finished a touch gesture. Clients may want to use this to re-enable advancing the seekbar.\n\n| Parameters ||\n|-----------|----------------------------------------------------------------------------------------------------|\n| `seekBar` | [SeekBar](/reference/kotlin/android/widget/SeekBar)!: The SeekBar in which the touch gesture began |"]]