add an image view at a new location on screen
<p>I want to add a new image view at the location where user touch the screen. Here is my code but I can't see the image.</p>

<p>
</p>

<pre><code>&lt;TextView
android:layout_alignParentTop="true"
android:background="#AA000000"
android:textColor="#ffffffff"
android:gravity="center_vertical"
android:layout_gravity="top" android:text="Coordinate: 0x0" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/textView"&gt;&lt;/TextView&gt;

&lt;ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/plane"/&gt;
</code></pre>

<p></p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    final TextView textView = (TextView)findViewById(R.id.textView);
    // this is the view on which you will listen for touch events
    final View touchView = findViewById(R.id.LinearLayout01);
    final View iv = findViewById(R.id.image);

    touchView.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {

            // this is the image to display once on touch events.
            iv.bringToFront();

            int y = (int)event.getY();
            int x = (int)event.getX();

            textView.setText("Coordinates: " +
                    String.valueOf(x + "x" + String.valueOf(y)));

            iv.layout(x, y, x, y);

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