Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Visualiser (com.chibde.visualizer.LineBarVisualizer) always in action even if switching activities #21

Open
shaikhsakib opened this issue Apr 17, 2019 · 0 comments

Comments

@shaikhsakib
Copy link

So i am using com.chibde.visualizer.LineBarVisualizer for some visual effect to songs playing in MediaPlayer. But the thing is when i change activity and come back to the activity where song was playing with visualiser the visualiser is gone. I am aware that LineBarVisualizer uses audiosessionid fr effect to show up. I am even trying to save the audiosessionid in savedinstance and restoring on restoresavedinstance but it responds only to orientation change, not to activity change

`public int getAudioId() {
if (mBound) {
if (mediaPlayer != null) {
audioId = mService.getAudioId();
}
}
return audioId;
}

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putInt("savedAudioID", getAudioId());

}

@Override
protected void onRestoreInstanceState(Bundle superState) {
    super.onRestoreInstanceState(superState);

    lineBarVisualizer.setPlayer(superState.getInt("savedAudioID"));

}

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant