Android SeekBar

Android SeekBar


Android SeekBar is the extension of ProgressBar. SeekBar allows the user to change the value using touch event/draggable thumb/left right arrow keys. SeekBar has a thumb that can be slided in order to choose a value between 0 and some maximum that can be set from the developer. The user can increase the value by dragging the thumb right or by pressing the right arrow key. Similarly the user can decrease the value by dragging the thumb left or by pressing the left arrow key.

The seekbar has three states: drag start, changing and drag ended.


In this example I will show you how to implement simple and custom SeekBar.


Let’s get start by creating a project in Eclipse IDE.

1. Create a new project in Eclipse by navigating to File ⇒ New Android ⇒ Application Project and fill required details. (I kept my main activity name as

2.  Create a layout file for under res ⇒ layout folder. I named the layout file as activity_main.xml. In this layout i had taken two SeekBar one for Simple and another for Custom.

3. For custom seekbar we need to create a new xml file for that in drawable folder and set it to seekbar as :

Here custom_progress is xml file created in drawable shown below :

4. Now, come to and add the following code. In this class we read the tracking on both seekbar and display the seek in textView as text and also work on three states of seekbar as listeners.

5. Now, run the app and you will get the output as shown in video.

Thanks. :)

Download Source Code


About the author

I am an Android developer for whom Android is the one and only love. I work as a freelancer which gets me and Android closer. I always love to share my learnings and love to learn from others knowledge too.



Leave a Comment

Comment (required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Name (required)
Email (required)