Skip to content

Instantly share code, notes, and snippets.

@pbrisbin
Created October 10, 2010 00:38
Show Gist options
  • Select an option

  • Save pbrisbin/618775 to your computer and use it in GitHub Desktop.

Select an option

Save pbrisbin/618775 to your computer and use it in GitHub Desktop.
private void loadStream() {
// run the stream in its own thread
Runnable r = new Runnable() {
public void run() {
try {
mediaPlayer = new MediaPlayer();
mediaPlayer.setDataSource(STREAM);
mediaPlayer.prepare();
mediaPlayer.start();
// dismiss the dialog
handler.sendEmptyMessage(0);
}
catch (IOException e) {
Log.e(APP, "error loading stream " + STREAM + ".", e);
return;
}
}
};
new Thread(r).start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment