title: Getting values from SeekBar in android
body: <p>How do I get values from a <code>SeekBar</code>?</p>
  
  <ul>
  <li>I have a code of a class that has three SeekBars (<code>PRICEbar</code>)</li>
  <li>I want to pass the values of these SeekBars to next Activity (screen)
  as Intents</li>
  <li>I know how toimplement OnClickListener but how can I extract the
  values from the SeekBars?</li>
  </ul>
  
  <p><strong>ex:</strong> if <code>PRICEbar</code> is pointing to value 10 ... I need to get the value of 10</p>
  
  <p><strong>Filters.java</strong></p>
  
  <pre><code>public class Filters extends Activity implements OnSeekBarChangeListener{
  
      // declare text objects variables
      private SeekBar PRICEbar; 
      private TextView PRICEtextProgress,DISTANCEtextProgress, RATINGtextProgress;
      Button back;
  
      /** 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("Price:: Rs "+progress);
                  seekBar.setMax(100);
              }
          });
      }
  
      @Override
      public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
          if (seekBar == PRICEbar)
              PRICEtextProgress.setText("Price:: Rs "+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>