Most visited

Recently visited

Added in API level 1

SeekBar

public class SeekBar
extends AbsSeekBar

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


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

From class android.widget.AbsSeekBar
From class android.widget.ProgressBar
From class android.view.View

Inherited constants

From class android.view.View

Inherited fields

From class android.view.View

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

From class android.widget.AbsSeekBar
From class android.widget.ProgressBar
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

XML attributes

android:thumb

Draws the thumb on a seekbar.

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

This corresponds to the global attribute resource symbol thumb.

Public constructors

SeekBar

Added in API level 1
SeekBar (Context context)

Parameters
context Context

SeekBar

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

Parameters
context Context
attrs AttributeSet

SeekBar

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

Parameters
context Context
attrs AttributeSet
defStyleAttr int

SeekBar

Added in API level 21
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
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
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

See also:

Hooray!