Android APIs
public class

SeekBar

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

Class Overview

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
Attribute Name Related Method Description
android:thumb Draws the thumb on a seekbar. 
[Expand]
Inherited XML Attributes
From class android.widget.AbsSeekBar
From class android.widget.ProgressBar
From class android.view.View
[Expand]
Inherited Constants
From class android.view.View
[Expand]
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.
[Expand]
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.

Related Methods

Public Constructors

public SeekBar (Context context)

Added in API level 1

public SeekBar (Context context, AttributeSet attrs)

Added in API level 1

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

Added in API level 1

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

Added in API level 21

Public Methods

public CharSequence getAccessibilityClassName ()

Added in API level 23

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.

public void setOnSeekBarChangeListener (SeekBar.OnSeekBarChangeListener l)

Added in API level 1

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 The seek bar notification listener