title: create vertical lines in seekbar
body: <p>I'm trying to create something like this<a href="https://i.stack.imgur.com/KRQuP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KRQuP.png" alt="this"></a>. The problem is how to create vertical lines close to the seekbar. I tried the code given <a href="http://www.bridgecrossing.co.uk/viewpost.php?post=80" rel="nofollow noreferrer">here</a>, but the seekbar line disappears. Any help would be appreciated. Here is what I've done so far.</p>
  
  <pre><code> public class MainActivity extends Activity {
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
              SeekBar sb = (SeekBar)findViewById(R.id.seekBar1);
  
  
  
              //Get the width of the main view.
              Display display = getWindowManager().getDefaultDisplay();
              Point displaysize = new Point();
              display.getSize(displaysize);
              int width = displaysize.x;
  
  
  
  
              //set the seekbar maximum (Must be a even number, having a remainder will cause undersirable results)
              //this variable will also determine the number of points on the scale.
              int seekbarmax = 10;
  
  
  
  
              int seekbarpoints = (width/seekbarmax); //this will determine how many points on the scale there should be on the seekbar
  
  
              //find the seekbar in the view, and set some behaviour properties
              SeekBar seekbar = (SeekBar)findViewById(R.id.seekBar1);
  
  
              //Set the seekbar to a max range of 10
              seekbar.setMax(seekbarmax);
  
  
  
  
              //Create a new bitmap that is the width of the screen
              Bitmap bitmap = Bitmap.createBitmap(width, 100, Bitmap.Config.ARGB_8888);
              //A new canvas to draw on.
              Canvas canvas = new Canvas(bitmap);
  
  
              //a new style of painting - colour and stoke thickness.
              Paint paint = new Paint();
              paint.setColor(Color.BLUE); //Set the colour to red
              paint.setStyle(Paint.Style.STROKE); //set the style
              paint.setStrokeWidth(1); //Stoke width
  
  
              Paint textpaint = new Paint(Paint.ANTI_ALIAS_FLAG);
              textpaint.setColor(Color.rgb(61, 61, 61));// text color RGB
              textpaint.setTextSize(28);// text size
  
  
  
  
              int point = 0; //initiate the point variable
  
  
              //Start a for loop that will loop seekbarpoints number of times.
              for (int i = 0; i &lt; seekbarpoints; i++  ){
  
  
  
  
                  if ((i%2)==0) {
                      //short line
                      point = point  + seekbarpoints;
                      canvas.drawLine(point, 30, point, 0, paint);
                      //drawLine(startx,startx,endy,endy)
  
              }
  
  
              //Create a new Drawable
              Drawable d = new BitmapDrawable(getResources(),bitmap);
  
  
              //Set the seekbar widgets background to the above drawable.
              seekbar.setProgressDrawable(d);
  
  
  
  
  
              }
          }
  
      }
  </code></pre>