Code example for Gallery

Methods: setOnItemClickListener, setOnItemSelectedListener

0
		grow = AnimationUtils.loadAnimation(this, R.anim.grow);
		rotate = AnimationUtils.loadAnimation(this, R.anim.rotate);
	} 
 
	private void setListeners() { 
		gallery.setOnItemClickListener(this);
		gallery.setOnItemSelectedListener(this);
	} 
 
	@Override 
	public void onItemSelected(AdapterView<?> arg0, View arg1, int position,
			long arg3) {
		switch (position) {
		case 0: 
			menuText.setText(R.string.play_button_text);
			break; 
		case 1: 
			menuText.setText(R.string.percussion_text);
			break; 
		case 2: 
			menuText.setText(R.string.settings_button_text);