Code example for ImageButton

Methods: performClick

0
				if (keyCode == KeyEvent.KEYCODE_MEDIA_NEXT) {
					nextTrack.performClick();
					return true; 
				} 
				if (keyCode == KeyEvent.KEYCODE_MEDIA_PREVIOUS) {
					prevTrack.performClick();
					return true; 
				} 
			} catch (IllegalStateException ex) {
				Toast.makeText(this, "Media Player in illegal state.",
						Toast.LENGTH_LONG).show();
			} 
		} 
		return super.onKeyDown(keyCode, event);
	} 
 
	@Override 
	public void onCompletion(MediaPlayer mp) {
		ListView lview = (ListView) findViewById(R.id.audioTracksListview);
		int count = lview.getCount();
		int nextItem = 0;