private void Seebar(){
final SeekBar seekbar = findViewById(R.id.Seekbar);
final TextView seekbar_text = findViewById(R.id.SeekBar_text);
seekbar.setProgress(Integer.parseInt(Music_num[1]));
seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@SuppressLint("SetTextI18n")
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
seekbar_text.setText(progress+"/100");
float VolumeNum = seekbar.getProgress()/100f;
Intent intent = new Intent(Setting.this,MusicService.class);
intent.putExtra("i",-1);
intent.putExtra("volume",VolumeNum);
startService(intent);
}
public void onStartTrackingTouch(SeekBar seekBar) { }
public void onStopTrackingTouch(SeekBar seekBar) {
try {
method.ReWrite(getFilesDir()+"Volume.txt", String.valueOf(seekbar.getProgress()), 1);
} catch (Exception v){
v.printStackTrace();
}
}
});
}