Code example for ListView

Methods: setSelection, getItemAtPosition

0
	/** 
	 * @param lview 
	 * @param nextItem 
	 */ 
	protected void playNextItem(ListView lview, int nextItem) {
		lview.setSelection(nextItem);
		AudioTrackContentInfo track = (AudioTrackContentInfo) lview
				.getItemAtPosition(nextItem);
		playingTrack.setText(track.getTitle());
		mediaPlayer.reset();
		try { 
			mediaPlayer.setDataSource(track.getDirectPlayUrl());
			mediaPlayer.prepare();
			mediaPlayer.start();
			currentPlayingItem = nextItem;
		} catch (IllegalStateException ex) {
 
		} catch (IOException ex) {
 
		} 
	}