package com.example.asynctask03;


import android.app.Activity;
import android.os.Bundle;
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
import android.widget.Toast;


//https://examples.javacodegeeks.com/android/android-soundpool-example/

// https://examples.javacodegeeks.com/android/core/media/audiomanager/android-audio-manager-example/

//http://www.tutorialspoint.com/android/android_audiomanager.htm

public class test extends Activity {
	 
    SeekBar sb;
    MediaPlayer mp;
    AudioManager am;
    int Volume=0;
    
    SeekBar seekbar1; //Your SeekBar
    int value;        //The SeekBar value output
    TextView result;  //The TextView which will display the result
    private TextView txt;
     
    protected void onCreate(Bundle b){
        super.onCreate(b);
        setContentView(R.layout.test_main);
        
        Bundle extras = getIntent().getExtras();
        String mp3 = extras.getString("name_mp3");
        
        txt = (TextView) findViewById(R.id.textView);
        txt.setText(mp3);
        
/*         
       // sb  =(SeekBar) findViewById(R.id.sbVolume);
       // mp = MediaPlayer.create(this, R.raw.say);
        am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
         
        mp.start();
        int maxVolume = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
        int curVolume = am.getStreamVolume(AudioManager.STREAM_MUSIC);
      /*   
        sb.setMax(maxVolume);
        sb.setProgress(curVolume);
         
        sb.setOnSeekBarChangeListener(this);*/
        
 /*     
        seekbar1 = (SeekBar)findViewById(R.id.sbBar);
        result = (TextView)findViewById(R.id.tvResult);
       
        
        seekbar1.setOnSeekBarChangeListener(new  SeekBar.OnSeekBarChangeListener() 
        { 
            public  void  onProgressChanged(SeekBar seekBar, int  progress,  boolean  fromUser)
            { 
            	value = progress;
                result.setText ("Value:"+value); 
            } 

            public  void  onStartTrackingTouch(SeekBar seekBar) {} 
            public  void  onStopTrackingTouch(SeekBar seekBar) {} 
        }); 
  */      
    }
    
    
}  