Set Image Name and Positions Programmatically
<p>Before I have hardcoded the positions of Image view and name but now I am retrieving it from the parser</p>

<p>I have ArrayList of the  Positions i.e. X , y and Image name which I retrieved from the xml. Now I want to assign it to my main3.xml layout which has Relative Layout and child as no of  ImageViews of which I have assign positions and this name.</p>

<p>Do I need to inflate the layout or any other idea ? or I should make 10 image views programatically</p>

<p>here is my main3.xml layout this is the hardcoded one now I want to give those topmargin_left and top via code..</p>

<pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/Level1Layout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="objectClick" 
            android:background="@drawable/hh_gmw_03"&gt;

    &lt;ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="593dp"
        android:layout_marginLeft="998dp" 
        android:onClick="objectClick" 
        android:contentDescription="Image1"
        android:tag="Image1"
        android:src="@drawable/hht3l01"/&gt;

    &lt;ImageView
        android:id="@+id/imageView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="39dp"
        android:layout_marginLeft="20dp" 
        android:onClick="objectClick" 
        android:contentDescription="Image1"
        android:tag="Image1"
        android:src="@drawable/hht3l02" /&gt;

    &lt;ImageView
        android:id="@+id/imageView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="153dp"
        android:layout_marginLeft="497dp" 
        android:onClick="objectClick" 
        android:contentDescription="Image1"
        android:tag="Image3"
        android:src="@drawable/hht3l03" /&gt;

    &lt;ImageView
        android:id="@+id/imageView4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="524dp"
        android:layout_marginLeft="998dp" 
        android:onClick="objectClick" 
        android:contentDescription="Image1"
        android:tag="Image4"
        android:src="@drawable/hht3l04" /&gt;

    &lt;ImageView
        android:id="@+id/imageView5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="183dp"
        android:layout_marginLeft="715dp" 
        android:onClick="objectClick" 
        android:contentDescription="Image1"
        android:tag="Image5"
        android:src="@drawable/hht3l05" /&gt;

    &lt;ImageView
        android:id="@+id/imageView6"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="413dp"
        android:layout_marginLeft="557dp" 
        android:onClick="objectClick" 
        android:contentDescription="Image1"
        android:tag="Image6"
        android:src="@drawable/hht3l06" /&gt;

    &lt;ImageView
        android:id="@+id/imageView7"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="53dp"
        android:layout_marginLeft="532dp" 
        android:onClick="objectClick" 
        android:contentDescription="Image1"
        android:tag="Image7"
        android:src="@drawable/hht3l07" /&gt;
&lt;/RelativeLayout&gt;
</code></pre>
