title: How does zindex work in android, how can I change the order later
body: <p>I have an XML Layout with imageButton and I want add "later" some imageButtons programmatically. Unfortunetly the added buttons cover the XML button. How can I use the zindex? Zindex attribute doesn't exist. I want @+id/btn_surface upper.</p>
  
  <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:scrollbars="none"
  &gt;
  
  &lt;HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="fill_parent"
      android:scrollbars="none"
      android:fillViewport="false"&gt;
  
      &lt;RelativeLayout
          android:id="@+id/rLayoutss"
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="5000px"
          android:layout_height="fill_parent"
          android:background="@drawable/repeattile"
          tools:context="com.some.asc.somesystems.SomeActivity"
          &gt;
  
          &lt;ImageView
              android:layout_height="fill_parent"
              android:layout_width="5000px"
              android:id="@+id/iw_pcover"
              android:background="@drawable/repeatovertile"
              android:layout_alignParentTop="true"
              android:layout_alignParentLeft="true"
              android:layout_alignParentStart="true"
  
              /&gt;
  
          &lt;RelativeLayout
              android:layout_width="800px"
              android:layout_height="480px"
              android:background="@color/gray"
              android:visibility="visible"
              android:id="@+id/rl_all_hud"
              &gt;
  
  
          &lt;LinearLayout
                  android:layout_width="105px"
                  android:layout_height="106px"
                  android:visibility="visible"
                  android:id="@+id/ll_surface"
                  android:orientation="vertical"&gt;
  
                  &lt;ImageButton
                      android:layout_width="106px"
                      android:layout_height="105px"
                      android:id="@+id/btn_surface"
                      android:background="@drawable/terr_button_surface"
                      /&gt;
  
                  &lt;TextView
  
                      android:layout_width="94px"
                      android:layout_height="105px"
                      android:id="@+id/tv_surface"
                      android:text="Surface"
                      android:layout_marginLeft="6dp"
                      android:layout_marginTop="-26dp"
                      android:textColor="@android:color/white"
                      android:textSize="14px"
                      android:shadowColor="@android:color/black"
                      android:shadowDx="2"
                      android:shadowDy="2"
                      android:shadowRadius="2"
                      /&gt;
  
              &lt;/LinearLayout&gt;
          &lt;/RelativeLayout&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/HorizontalScrollView&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>Add imageButton:</p>
  
  <pre><code>    RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.rLayoutss);
      ImageButton largeIcon = new ImageButton(context);
      largeIcon.setImageResource(
           getResources().getIdentifier(PObject.getString("imgsrc"), "drawable", getPackageName())
      );
      RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(80,80);
      lp.leftMargin = 100;
      lp.topMargin = 100;
      largeIcon.setLayoutParams(lp);
      largeIcon.setScaleType(ImageView.ScaleType.FIT_CENTER);
      largeIcon.setBackgroundColor(Color.TRANSPARENT);
  
      relativeLayout.addView(largeIcon);
  </code></pre>
  
  <p>Thanks for any help</p>