title: Implementing Simple SeekBar in android
body: <p><strong>Filters.java</strong></p>
  <pre><code>public class Filters extends Activity implements OnSeekBarChangeListener{
      private SeekBar PRICEbar,DISTANCEbar, RATINGbar; // declare seekbar object variable
      // declare text label objects
      private TextView PRICEtextProgress,DISTANCEtextProgress, RATINGtextProgress;
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          // load the layout
          setContentView(R.layout.filters);     
          PRICEbar = (SeekBar)findViewById(R.id.PRICEseekBarID); // make seekbar object
          PRICEbar.setOnSeekBarChangeListener(this); 
          PRICEbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
  
              @Override
              public void onStopTrackingTouch(SeekBar seekBar) {
                  // TODO Auto-generated method stub
  
              }
  
              @Override
              public void onStartTrackingTouch(SeekBar seekBar) {
                  // TODO Auto-generated method stub
  
              }
  
              @Override
              public void onProgressChanged(SeekBar seekBar, int progress,
                      boolean fromUser) {
                  // TODO Auto-generated method stub
                  PRICEtextProgress = (TextView)findViewById(R.id.PRICEtextViewProgressID);
                  PRICEtextProgress.setText(&quot;Price:: Rs &quot;+progress);
  
              }
          });
  
  }
      @Override
      public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
          if (seekBar == PRICEbar)
              PRICEtextProgress.setText(&quot;Price:: Rs &quot;+progress);
      }
      @Override
      public void onStartTrackingTouch(SeekBar seekBar) {
          // TODO Auto-generated method stub
  
      }
      @Override
      public void onStopTrackingTouch(SeekBar seekBar) {
          // TODO Auto-generated method stub
  
      }
  
  
  
  }
  </code></pre>
  <p><strong>filters.xml</strong></p>
  <pre><code>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:orientation=&quot;vertical&quot; &gt;
  
      &lt;RelativeLayout
          android:id=&quot;@+id/relativeLayoutforPRICE&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;wrap_content&quot; &gt;
  
          &lt;TextView
              android:id=&quot;@+id/PRICEtextViewProgressID&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_alignParentLeft=&quot;true&quot;
              android:layout_alignParentTop=&quot;true&quot;
              android:text=&quot;Price&quot;
              android:textAppearance=&quot;?android:attr/textAppearanceLarge&quot; &gt;
          &lt;/TextView&gt;
  
          &lt;SeekBar
              android:id=&quot;@+id/PRICEseekBarID&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_alignParentLeft=&quot;true&quot;
              android:layout_below=&quot;@+id/textView1&quot;
              android:layout_marginTop=&quot;26dp&quot;            
              android:max=&quot;100&quot; &gt;
          &lt;/SeekBar&gt;
      &lt;/RelativeLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>I have an output like this::</p>
  <p><img src="https://i.stack.imgur.com/jr6r0.png" alt="image of obnoxious slider for selecting amount" /></p>
  <p>How to modify my code to get initial and final values in the seek bar as in figure below?</p>
  <p><img src="https://i.stack.imgur.com/cDhew.png" alt="obnoxious slider with min 0 and max 100, but these values should be configurable from other inputs" /></p>