Android : Display coordinates x,y using drawtext when ontouch
<p>I want to display the coordinates of nodes which is placed on the view with the ontouch event, the coordinates are to be placed beside the circle nodes,temporarily i'm using (0,0) but i have no idea how to implement the real coordinates on the nodes properly,need some help.thanks</p>

<pre><code>public class DrawView extends View implements OnTouchListener {
List&lt;Point&gt; points = new ArrayList&lt;Point&gt;();
Paint paint = new Paint();

public DrawView(Draw context) {
    super(context);
    setFocusable(true);
    setFocusableInTouchMode(true);
    this.setOnTouchListener(this);
    paint.setColor(Color.RED);
    paint.setAntiAlias(true);

}
@Override
public void onDraw(Canvas canvas) {
    Paint rectanglePaint = new Paint();
    rectanglePaint.setColor(Color.WHITE);
    Paint layoutColor = new Paint();
    layoutColor.setColor(Color.BLACK);      
    canvas.drawRect(new Rect(10,10,465,800), rectanglePaint);
    canvas.drawLine(300, 10, 300, 800, layoutColor);
    canvas.drawLine(0, 300, 465, 300, layoutColor);


//  Paint textPaint = new Paint();
//  textPaint.setColor(Color.CYAN);
//  textPaint.setTextSize(30);
//  canvas.drawText("Room", 220, 400, textPaint);




    for (Point point : points) {


        canvas.drawText("(0,0)", point.x+5, point.y+5, paint);
        canvas.drawCircle(point.x, point.y, 5, paint);
      //  Log.d(TAG, "Painting: "+point);
    }
}
final TextView textView = ( TextView )findViewById(R.id.textView1);
public boolean onTouch(View view, MotionEvent event) {
    // return super.onTouchEvent(event);
    Point point = new Point();
    point.x = event.getX();
    point.y = event.getY();
    points.add(point);
    invalidate();



    return true;
}
</code></pre>

<p>}</p>
