 <p>Generic info about buttons <a href="http://developer.android.com/reference/android/widget/Button.html" rel="nofollow">here</a></p> <p>To use image for a button you need an <a href="http://developer.android.com/reference/android/widget/ImageButton.html" rel="nofollow">android.widget.ImageButton</a>. Example of drawable selector (put it in res/drawable/):</p> <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:state_pressed="true" android:drawable="@drawable/button_pressed" /&gt; &lt;!-- pressed --&gt; &lt;item android:state_focused="true" android:drawable="@drawable/button_focused" /&gt; &lt;!-- focused --&gt; &lt;item android:drawable="@drawable/button_normal" /&gt; &lt;!-- default --&gt; &lt;/selector&gt; </code></pre> <p>So you can use different images for various states. To generate buttons on the fly you can define base layout with any layout manager (FrameLayout, RelativeLayout, LinearLayout), find it by id (findViewById()) within your Activity and make it visible: </p> <pre><code>public void createContainerForImageView() { LinearLayout container = new LinearLayout(this); container.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); container.setOrientation(LinearLayout.HORIZONTAL); ImageView img=(ImageView)findViewById(R.id.ImageView01); Bitmap bmp=BitmapFactory.decodeResource(getResources(), R.drawable.sc01); int width=200; int height=200; Bitmap resizedbitmap=Bitmap.createScaledBitmap(bmp, width, height, true); img.setImageBitmap(resizedbitmap); container.addView(img); // or you can set the visibility of the img } </code></pre> <p>Hope this helps.</p>