Code example for Gallery

Methods: setOnItemClickListener

0
		addPictureButton.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				pressAddPictureButton(); 
			} 
		}); 
		gallery.setOnItemClickListener(new OnItemClickListener() {
			public void onItemClick(AdapterView<?> parent, View view,
					int position,
					long id) {
				clickPicture(id);
 
			} 
 
		}); 
 
	} 
 
	protected void clickPicture(long id) {
		picture = new PictureController(getBaseContext()).getPictureFromId(id);
		launchEditPicture(); 
	}