Android SeekBar

  • Android SeekBar is a kind of ProgressBar with draggable thumb. The end user can drag the thum left and right to move the progress of song, file download etc.
  • The SeekBar.OnSeekBarChangeListener interface provides methods to perform even handling for seek bar.
  • Android SeekBar and RatingBar classes are the sub classes of AbsSeekBar.

http://i1172.photobucket.com/albums/r575/gabwerkz/20120205122451.png

Android SeekBar Example

activity_main.xml

Drag the seek bar from the pallete, now activity_main.xml will look like this:

File: activity_main.xml

Activity class

The Activity class displaying seek bar and performing event handling.

File: MainActivity.java

Output:

android-seekbar-output2

Facebook