Can Anyone Tell me Why All Rects fires to same Activity
<p>*<em>MyImage class Extends View And Implements ontouchListener *</em>
<code>enter code here</code></p>

<p>public class MyImage extends View implements OnTouchListener {</p>

<pre><code>Bitmap orignal;
Bitmap scaled;
Matrix m;
Context ctext;
ArrayList&lt;Rect&gt; rect;
</code></pre>

<p><strong>I have Four Rectangle and  all Rectangle are used to move to 
diff diff Activity</strong>
        Rect rectangle0;
    Rect rectangle1;
    Rect rectangle2;
    Rect rectangle3;
    Rect rectangle4;
    private int X_POSITION;
    private int Y_POSITION;</p>

<pre><code>public MyImage(Context context) {
    super(context);

    ctext = context;

}


@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    // TODO Auto-generated method stub
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);

}

@Override
public View findFocus() {
    // TODO Auto-generated method stub
    return super.findFocus();
}

@Override
public boolean isPressed() {
    // TODO Auto-generated method stub
    return super.isPressed();

}

@Override
public boolean isSelected() {
    // TODO Auto-generated method stub
    return super.isSelected();

}



@Override
public boolean onTouchEvent(MotionEvent event) {


     X_POSITION = (int)event.getX();
     Y_POSITION = (int)event.getY();

    System.out.println(X_POSITION + "\t" +Y_POSITION); 
</code></pre>

<p><strong>The Problem Occur here i dnt know why all rectangle fires to same activity and how can it be solved so that all rectangle fire to diff actvity</strong></p>

<pre><code>    switch (event.getAction()) {

    case MotionEvent.ACTION_DOWN:


        Intent i = new Intent(ctext , SelecterImage.class);
        ctext.startActivity(i);

    }
</code></pre>

<p>return true;</p>

<pre><code>}

@Override
public void onDraw(Canvas canvas) {
    Paint paint = new Paint();

    int X_WIDTH = canvas.getWidth();
    int Y_HEIGHT = canvas.getHeight() / 2;

    System.out.println(X_WIDTH + "\n" + Y_HEIGHT);

    Paint rectanglePaint = new Paint();
    rectanglePaint.setARGB(255, 0, 0, 0);
    rectanglePaint.setStrokeWidth(2);
    rectanglePaint.setColor(Color.BLUE);

    rectangle0 = new Rect(10, 420, 60, 380);
    rectangle1 = new Rect(70, 420, 120, 380);


    rectangle2 = new Rect(130, 420, 180, 380);
    rectangle3 = new Rect(190, 420, 240, 380);
    rectangle4 = new Rect(250, 420, 300, 380);


    canvas.drawRect(rectangle0, rectanglePaint);

    canvas.drawRect(rectangle1, rectanglePaint);

    canvas.drawRect(rectangle2, rectanglePaint);

    canvas.drawRect(rectangle3, rectanglePaint);

    canvas.drawRect(rectangle4, rectanglePaint);

    scaled = Bitmap.createScaledBitmap(orignal, X_WIDTH, Y_HEIGHT, false);

    canvas.drawBitmap(scaled, 0, 0, paint);

}


void setBitmap(Bitmap bitmap) {
    // TODO Auto-generated method stub

    orignal = bitmap;

}



@Override
public boolean onTouch(View v, MotionEvent event) {
    return false;
    // TODO Auto-generated method stub




}   


}
</code></pre>

<p><strong>strong text</strong></p>
