Code example for AudioManager

Methods: requestAudioFocus

0
            updatePlayPause(); 
        } 
    }; 
     
    private void start() { 
        mAudioManager.requestAudioFocus(mAudioFocusListener, AudioManager.STREAM_MUSIC,
                AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
        mPlayer.start();
        mProgressRefresher.postDelayed(new ProgressRefresher(), 200);
    } 
     
    public void setNames() { 
        if (TextUtils.isEmpty(mTextLine1.getText())) {
            mTextLine1.setText(mUri.getLastPathSegment());
        } 
        if (TextUtils.isEmpty(mTextLine2.getText())) {
            mTextLine2.setVisibility(View.GONE);
        } else { 
            mTextLine2.setVisibility(View.VISIBLE);
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE