I've just finished copying the android walkthrough for the gallery (http://developer.android.com/resources/tutorials/views/hello-gallery.html) and was wondering how I would go about having the thumbnail photo scale into a larger one within the onClickItem method.
public void onItemClick(AdapterView parent, View v, int position, long id) {
Toast.makeText(ProjectPreview.this, "" + position, Toast.LENGTH_SHORT).show();
}
Currently it just shows the position as depicted in the Toast. Could someone point me in the right direction or show me a simple way?
Thanks in advance.
EDIT: Added this method and called it in the onItemClick sending it the position. And it works.
public void showLarger(int position){
ImageView image = (ImageView) findViewById(R.id.iv1);
image.setLayoutParams(new Gallery.LayoutParams(200, 100));
image.setScaleType(ImageView.ScaleType.FIT_XY);
image.setImageResource(mImageIds[position]);
}