Code example for Gallery

Methods: getVisibility, setVisibility

0
			} 
		}); 
         
        imageView.setOnClickListener(new OnClickListener(){
			public void onClick(View v) {
				if(ga.getVisibility() == View.VISIBLE){
					ga.setVisibility(View.GONE);
				} 
				else{ 
					ga.setVisibility(View.VISIBLE);
				} 
			}} 
        ); 
         
        ga.setCallbackDuringFling(false);
        ga.setOnItemSelectedListener(new OnItemSelectedListener() {
 
			public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
				Log.d(TAG, "Image onItemSelected: " + position);
				setLargeImage(position);
			}