Code example for Gallery

Methods: setAdapter, setOnItemClickListener

0
		    
	   }//CLOSE DOWNLOAD IMAGES 
	public void gallery(){ 
	  imgAdapt = new PicAdapter(this,bit_array);
		//set the gallery adapter 
		picGallery.setAdapter(imgAdapt);
		picGallery.setOnItemClickListener(new OnItemClickListener() {
		        public void onItemClick(AdapterView<?> parent,
		          View v, int position, long id) {
		          
		        	Bitmap bitmap = bit_array[position];
		         //uploading_image=key_paths.get(position); 
		       //  Log.d("imageee",key_paths.get(position)); 
		         Toast.makeText(GalleryShowDetailsCRActivity.this,
		           "Click on a photo to be enlarged", 
		              Toast.LENGTH_LONG).show();
		          
		        // Bitmap bitmap = resample(imageInSD); 
		         picView.setImageBitmap(bitmap);
		          
		        }