title: how to set seek bar in android with default values..?
body: <p>The maximum value of <code>SeekBar</code> is 100 then How to set  a <code>Seekbar</code> values default  as 50 (starting at 50%). The seek bar will be start at 50.</p>
  
  <p>I got a sample code but it will start at 0 to 100. 
  Please answer me if you have any idea... 
  Thank you.</p>
  
  <pre><code>     public class MainActivity extends Activity implements OnSeekBarChangeListener{
       private SeekBar bar; // declare seekbar object variable
       // declare text label objects
       private TextView textProgress,textAction;
       /** Called when the activity is first created. */
       @Override
       public void onCreate(Bundle savedInstanceState)
       {
      super.onCreate(savedInstanceState);
      // load the layout
      setContentView(R.layout.activity_main);     
      bar = (SeekBar)findViewById(R.id.seekBar1); // make seekbar object
      bar.setOnSeekBarChangeListener(this); // set seekbar listener.
      // since we are using this class as the listener the class is "this"
  
      // make text label for progress value
      textProgress = (TextView)findViewById(R.id.textViewProgress);
      // make text label for action
      textAction = (TextView)findViewById(R.id.textViewAction);
  
      }
  
      @Override
      public void onProgressChanged(SeekBar seekBar, int progress,
          boolean fromUser) {
      // TODO Auto-generated method stub
  
      // change progress text label with current seekbar value
      textProgress.setText("The value is: "+progress);
      // change action text label to changing
      textAction.setText("changing");
      }
  
      @Override
      public void onStartTrackingTouch(SeekBar seekBar) {
      // TODO Auto-generated method stub
      textAction.setText("starting to track touch");
  
      }
  
      @Override
      public void onStopTrackingTouch(SeekBar seekBar) {
      // TODO Auto-generated method stub
      seekBar.setSecondaryProgress(seekBar.getProgress());
      textAction.setText("ended tracking touch");     
      }
  
       }
  </code></pre>