android sdk set imageview x y coordinates
<p>I'm using an absolutelayout (I know its deprecated). I am adding imageview dynamically but I can't change its position from the top left corner of the screen.</p>

<pre><code>ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.orb1);
this.addContentView(iv, new AbsoluteLayout.LayoutParams(80, 80, 200, 200));
</code></pre>

<p>However, this creates the image with top left at 0, 0 instead of anywhere else. If I change the last two values of Layout Params it still remains in that position.</p>

<p>Can someone assist? Thanks.</p>

<p>Edit: Using relative layout still doesn't work </p>

<pre><code>ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.orb1);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(80, 80);
params.topMargin=50;
params.leftMargin=50;
this.addContentView(iv, params);
</code></pre>
