Android eclipse
<p>I am trying to create buttons at run time, which I did. The problem is they all overlap each other. I want to change the position and nothing is working! </p>

<p>Here is my code:</p>

<pre><code>for (int i = 1; i &lt; 5; i++) {
    RelativeLayout.LayoutParams p= new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
    Button b = new Button(this);
    b.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub

        }
    });
    b.setText(""+ i);      
    b.setId(100+i);
    b.setWidth(50);
    b.setHeight(40);

    p1.this.addContentView(b, p);              
}
</code></pre>
