-
-
Save codingwithsara/029490049af5c7d15e2d1bb1bc0309b7 to your computer and use it in GitHub Desktop.
Android MusicPlayer 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Media Playerの初期化 | |
mp = MediaPlayer.create(this, R.raw.music); | |
mp.setLooping(true); | |
mp.seekTo(0); | |
mp.setVolume(0.5f, 0.5f); | |
// 音量調節 | |
volumeBar = findViewById(R.id.volumeBar); | |
volumeBar.setOnSeekBarChangeListener( | |
new SeekBar.OnSeekBarChangeListener() { | |
@Override | |
public void onProgressChanged(SeekBar seekBar, int i, boolean b) { | |
} | |
@Override | |
public void onStartTrackingTouch(SeekBar seekBar) { | |
} | |
@Override | |
public void onStopTrackingTouch(SeekBar seekBar) { | |
} | |
} | |
); | |
} | |
public void playBtnClick(View view) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment