title: Place imageview below imageview programmatically
body: <p>I'm trying to place an imageview below another using layout parameters, but it is not working..
  I want to accomplish this: <a href="http://imgur.com/eZfEI" rel="nofollow">http://imgur.com/eZfEI</a></p>
  
  <pre><code>RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
  params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE);
  
                      iv_album[i] = new ImageView(main.this);
                      iv_album[i].setImageBitmap(resized_a_p);
                      iv_album[i].setPadding(0, 5, 5, 0);
                      iv_album[i].setId(i);
                      iv_album[i].setOnLongClickListener(main.this);
                      iv_album[i].setOnClickListener(main.this);
                      if (i&gt;1){
                          params.addRule(RelativeLayout.BELOW, iv_album[i].getId() - 1);
                      }
  </code></pre>
  
  <p>what is wrong  ?</p>