You have two options.
either use ViewFlipper or the Android gallery.
I prefer to use the Android gallery as it will be controlled and better suited.
In the default default Android gallery, you will find the .android.com developer site. ImageView is returned in the adapter used and in the getView () method. You manipulate your code so that it returns an inflated XML layout, for example, the following code
class ImageAdapter extends BaseAdapter {
int mGalleryItemBackground;
private Context mContext;
public ImageAdapter(Context c) {
mContext = c;
TypedArray a = obtainStyledAttributes(R.styleable.HelloGallery);
mGalleryItemBackground = a.getResourceId(
R.styleable.HelloGallery_android_galleryItemBackground, 0);
a.recycle();
}
public int getCount() {
return 5;
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
convertView = LayoutInflater.from(mContext).inflate(R.layout.ownview, null);
return convertView;
}
}