0
    private TextView associatedTextView;
 
    private ProgressBarThread barThread;
 
    private AudioPlayer(Activity context, ProgressBar bar, TextView text) {
        androidMediaPlayer.setOnPreparedListener(this);
        androidMediaPlayer.setOnBufferingUpdateListener(this);
        androidMediaPlayer.setOnCompletionListener(this);
        androidMediaPlayer.setOnSeekCompleteListener(this);
        androidMediaPlayer.setOnErrorListener(this);
 
        init(context, bar, text);
    } 
 
    private void init(Activity context, ProgressBar bar, TextView text) {
        this.associatedProgressBar = bar;
        this.associatedTextView = text;
        this.context = context;
 
        barThread = new ProgressBarThread(associatedProgressBar,
                androidMediaPlayer);
        // en cas de resume on relance le thread, celui-ci mettra (ou pas) la 
        // barre à jour 
        new Thread(barThread).start();
    } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE