Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

SeekBar

public class SeekBar
extends AbsSeekBar

java.lang.Object
   ↳ android.view.View
     ↳ android.widget.ProgressBar
       ↳ android.widget.AbsSeekBar
         ↳ android.widget.SeekBar


A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys. Placing focusable widgets to the left or right of a SeekBar is discouraged.

Clients of the SeekBar can attach a SeekBar.OnSeekBarChangeListener to be notified of the user's actions.

Summary

Nested classes

interface SeekBar.OnSeekBarChangeListener

A callback that notifies clients when the progress level has been changed. 

XML attributes

android:thumb Draws the thumb on a seekbar. 

Inherited XML attributes

Inherited constants

Inherited fields

Public constructors

SeekBar(Context context)
SeekBar(Context context, AttributeSet attrs)
SeekBar(Context context, AttributeSet attrs, int defStyleAttr)
SeekBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public methods

CharSequence getAccessibilityClassName()

Return the class name of this object to be used for accessibility purposes.

void setOnSeekBarChangeListener(SeekBar.OnSeekBarChangeListener l)

Sets a listener to receive notifications of changes to the SeekBar's progress level.

Inherited methods

XML attributes

android:thumb

Draws the thumb on a seekbar.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

Public constructors

SeekBar

added in API level 1
public SeekBar (Context context)

Parameters
context Context

SeekBar

added in API level 1
public SeekBar (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

SeekBar

added in API level 1
public SeekBar (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

SeekBar

added in API level 21
public SeekBar (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

defStyleRes int

Public methods

getAccessibilityClassName

added in API level 23
public CharSequence getAccessibilityClassName ()

Return the class name of this object to be used for accessibility purposes. Subclasses should only override this if they are implementing something that should be seen as a completely new class of view when used by accessibility, unrelated to the class it is deriving from. This is used to fill in AccessibilityNodeInfo.setClassName.

Returns
CharSequence

setOnSeekBarChangeListener

added in API level 1
public void setOnSeekBarChangeListener (SeekBar.OnSeekBarChangeListener l)

Sets a listener to receive notifications of changes to the SeekBar's progress level. Also provides notifications of when the user starts and stops a touch gesture within the SeekBar.

Parameters
l SeekBar.OnSeekBarChangeListener: The seek bar notification listener