Gallery binging Layouts
<p>I am new to android and I am working in an application that want to swipe my layouts. Is it possible to bind layouts to android widget Gallery. Or please advice me the best practice to swipe my layouts in android. </p>

<p>Please help me with a valid link if possible</p>

<p>Thanks in advance.</p>

<p>My main class</p>

<pre><code>public class GalleryTestActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Gallery gallery = (Gallery) findViewById(R.id.gallery);
        gallery.setAdapter(new ImageAdapter(this));


}
}
</code></pre>

<p>My base class</p>

<pre><code>public class ImageAdapter extends BaseAdapter {
    int mGalleryItemBackground;
    private Activity mContext;
    private Gallery mGallery; 


    private Integer[] mImageIds = {
            R.layout.instruction,
            R.layout.instruction2

    };

    public ImageAdapter(Activity c)
    {
        mContext=c;
        TypedArray attr = mContext.obtainStyledAttributes(R.styleable.HelloGal999lery);
        mGalleryItemBackground = attr.getResourceId(
                R.styleable.HelloGal999lery_android_galleryItemBackground, 100);
        attr.recycle();
    }



    public int getCount() {
        return mImageIds.length;
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
            //Help me here
        View rowView = convertView;
        if(rowView==null)
        {
            LayoutInflater inflater = mContext.getLayoutInflater();
             rowView = inflater.inflate(mImageIds[position], null, true);
        }
        return rowView;

    }
}
</code></pre>
