Adding next and previous button in Grid view
<p>I am showing a Grid view in Alert dialog. Grid view consists of images which are stored in an array.</p>

<p>I am showing 9 images at a time in grid view, now there are two buttons below grid view 
"Next" &amp; "Previous".</p>

<p>If click on "Next" it will show next 9 images from the array and similarly with "Previous". Please tell me how to proceed and if possible provide me some sample code.</p>

<p>I tried this code, please say if i can use any other logic..</p>

<pre><code>public View getView(int position, View convertView, ViewGroup parent) 
{
    ImageView imageView;
    imageView = new ImageView(mContext);    

if(no_of_image &lt; mThumbIds.length &amp;&amp; no_of_image &lt; screen_no)
    {

        if (convertView == null)   // if it's not recycled, initialize some attributes
            {
                imageView.setLayoutParams(new       GridView.LayoutParams(80, 80));
                imageView.setScaleType(ImageView.ScaleType.FIT_XY);
                imageView.setPadding(8, 8, 8, 8);
            } 
        else 
            {
                imageView = (ImageView) convertView;
            }

            imageView.setImageResource(mThumbIds[no_of_image]);
            no_of_image++;
    }




    return imageView;   
</code></pre>

<p>screen_no is the no. of images to be shown in one grid view. in my case it is 9.
and mThumbIds is the array from where i am loading the images.</p>
