private void buttonPlayClick() { startScroll(); buttonPlay.setImageResource(R.drawable.mp_play_hover); startService(playbackServiceIntent); }
public int onStartCommand(Intent intent, int flags, int startId) { if (!mediaPlayer.isPlaying()) { mediaPlayer.start(); super.onCreate(); } return START_STICKY; }
onCreate() { mediaPlayer = new MediaPlayer(); try { mediaPlayer .setDataSource("xyz"); } catch (IllegalArgumentException e) { } catch (IllegalStateException e) { } catch (IOException e) { } mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); try { mediaPlayer.prepare(); } catch (IllegalStateException e) { } catch (IOException e) { } // MediaPlayer starts to load data from URL mediaPlayer.setOnCompletionListener(this); notifyMe(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)