title: How to make a bitmap using canvas clickable?
body: <p>How do i make the bitmap created clickable?
  Below is the code which i have used to create a bitmap using canvas.  </p>
  
  <pre><code> public class DrawView extends View implements OnClickListener
  {
      public DrawView(Context context)
      {
          super(context);
          paint = new Paint();
          image = BitmapFactory.decodeResource(getResources(), R.drawable.andmrktsmall);
      }
  
      @Override
      protected void onDraw(Canvas canvas)
      {
          super.onDraw(canvas);
          int canWidth = canvas.getWidth();
          int canHeight = canvas.getHeight();
          int width = (canWidth - 200) / 2;
          int height = (canHeight - 100) / 2;
          Bitmap indexcanvas = Bitmap.createScaledBitmap(image, 200, 100, true);
          canvas.drawBitmap(indexcanvas, width, height, paint);
          this.setBackgroundColor(Color.YELLOW);
  
      }
  
      @Override
      public void onClick(View v)
      {
          Toast.makeText(context, "View is clicked", 1).show();
      }
  
  }
  </code></pre>