brijesh kumar
1 min readApr 12, 2017

--

I have Media Player that also provides equalizer bands. In order to initialise Equalizer, I need AudioSessionId of media player. Mediaplayer class has method ‘mp.getAudioSessionId()’ but how can I access MediaPlayer instance in UI activity that is connected to the MediaBrowserService through MediaBrowser. I’ve initialised MediaPlayer instance in MediaBrowserService. I have a way to do this by connecting to the service with ‘bind’ method, calling from the activity. But if service is already connected with mediaBrowser, again attempting to connect with the same service is not a good idea as I think. Please suggest a way…

--

--