Managing layout runtime android
<p>I am getting runtime dynamic imagebutton displayed but i am having some things that are displayed on the screen before, so now when i add my runtime imagebutton it will overlap the previous static display and i want to add the runtime imagebutton after the static layout which comes through xml. please help.</p>

<pre><code>        for (int i =0;i&lt;adapt_objmenu.image_array.length;i++){
         ImageButton b1 = new ImageButton(myrefmenu);
            b1.setId(100 + i);
            b1.setImageResource(R.drawable.bullet_1);
         //   b1.setPadding(left, top, right, bottom)
          b1.setPadding(0, 10, 0, 10);

          b1.setBackgroundColor(R.drawable.bg_navitionbar);




           // b1.setText(adapt_objmenu.city_name_array[i]);
            RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
            if (i &gt; 0) {
                lp.addRule(RelativeLayout.RIGHT_OF, b1.getId() - 1);
            }   
            b1.setLayoutParams(lp);
            relative.addView(b1);

    //relate.addView(b1, i,  new RelativeLayout.LayoutParams(width,height));

    //height = height+80;



    }
</code></pre>
