title: Extended View not scrolling
body: <p>Im trying to build a piano app, i have gone through <a href="https://stackoverflow.com/questions/15091218/how-to-create-layout-for-piano">this link</a></p>
  
  <p>i was able to create view which draws series of black and white keys.I dont know how to scroll horizontally, Since iam not using any xml file for the view.</p>
  
  <p><strong>Here is the code for My MainActivity:</strong></p>
  
  <pre><code>public class MainActivity extends Activity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(new MyTouch(this));
  //setContentView(R.layout.activity_main);
  }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
  getMenuInflater().inflate(R.menu.activity_main, menu);
  return true;
  }
  }
  </code></pre>
  
  <p><strong>Here is the code for MyTouch:</strong> <em>the same code specified in the above link.</em></p>
  
  <pre><code>public class MyTouch extends View {
  public MyTouch(Context context) {
      super(context);
  }
  Bitmap whiteKey, blackKey;
  Paint paint = new Paint();
  
  public void draw(Canvas canvas) {
      if (whiteKey == null) {
          whiteKey = BitmapFactory.decodeResource(getResources(), R.drawable.white);
      }
      if (blackKey == null) {
          blackKey = BitmapFactory.decodeResource(getResources(), R.drawable.black);
      }
  
      int keys = 5;
  
      // draw white keys
      for (int i = 0; i &lt; keys; i++) {
          canvas.drawBitmap(whiteKey, i * whiteKey.getWidth(), 0, paint);
      }
      // draw black keys
      for (int i = 0; i &lt; keys; i++) {
          if (i != 3 &amp;&amp; i != 7) {
              canvas.drawBitmap(blackKey, i * blackKey.getWidth()+blackKey.getWidth()*0.5f, 0, paint);
          }
      }
  }
  
  };
  </code></pre>
  
  <p>I have searched Google,and tried many examples, but none of them is working for me.More over this view contains a drawn canvas, and iam new to this canvas and drawings !!</p>