Image GrideView display Large Image when user Click
<p>Dear all android programmer, I am coding Image GrideView in android and I would like to question you how to show Large image when user click on small image in grideview and how can I make GrideView able to scrolling by swipe because my gellery has alot images:</p>

<h1>Here is my code</h1>

<pre><code>public class myalbum extends Activity {

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.myalbum);

    GridView gridView = (GridView) findViewById(R.id.gridview);
    gridView.setAdapter(new ImageAdapter(this));

    gridView.setOnItemClickListener(new GridView.OnItemClickListener() 
    {
        public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) 
        {                
            //Here I want to see Large Image???? How can i do?????
            Toast.makeText(myalbum.this, "" + position, Toast.LENGTH_SHORT).show();
        }
    });        
}

public class ImageAdapter extends BaseAdapter {
    private Context mContext;

    public ImageAdapter(Context c) {
        mContext = c;
    }

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

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

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

    HashMap&lt;Integer, Matrix&gt; mImageTransforms = new HashMap&lt;Integer,Matrix&gt;();
    Matrix mIdentityMatrix = new Matrix();
    //---returns an ImageView view---
 // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView imageView;
        if (convertView == null) {  // if it's not recycled, initialize some attributes
            imageView = new ImageView(mContext);
            imageView.setLayoutParams(new GridView.LayoutParams(88, 88));
            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
            imageView.setPadding(2, 2, 2, 2);
        } else {
            imageView = (ImageView) convertView;
        }

        Matrix m = mImageTransforms.get(position);
        if ( null == m ) {
            m = mIdentityMatrix;
        }
        imageView.setImageMatrix(m);
        imageView.setImageResource(mThumbIds[position]);
        return imageView;
    }

    void setImageRotation(int position, int degrees) {
        Matrix m = mImageTransforms.remove(position);        
        if ( degrees != 0 ) {
            if ( null == m ) m = new Matrix();
            m.setRotate(degrees);
            mImageTransforms.put(position, m);
        }
        notifyDataSetChanged();
    }

    private Integer[] mThumbIds = {
            R.drawable.p1, R.drawable.p2,
            R.drawable.p1, R.drawable.p2,
            R.drawable.p1, R.drawable.p2,
            R.drawable.p1, R.drawable.p2,
            R.drawable.p3, R.drawable.p4
    };
}
 }
</code></pre>

<p>Best Regards,
Virak</p>
