mediaBrowser.connect() crash
See original GitHub issueIn android 8.0 or above, I met a problem.
when i called MediaBrowser.connect() ,it will crash sometimes.
Caused by java.lang.IllegalStateException: connect() called while neither disconnecting nor disconnected (state=CONNECT_STATE_CONNECTING) at android.media.browse.MediaBrowser.connect(MediaBrowser.java:152) at android.support.v4.media.MediaBrowserCompatApi21.connect(Unknown Source:2) at android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21.connect(Unknown Source:2) at android.support.v4.media.MediaBrowserCompat.connect(Unknown Source:2)
Looks like connect() being called multiple times.But I called disconnect() in onStop().
I can’t reproduce it ,I just saw it in the fabric log.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Developers - mediaBrowser.connect() crash - - Bountysource
In android 8.0 or above, I met a problem. when i called MediaBrowser.connect() ,it will crash sometimes. Caused by java.lang.
Read more >Building a media browser client - Android Developers
If the connection is successful, the onConnect() callback creates the media controller, links it to the media session, links your UI controls to ......
Read more >java.lang.IllegalStateException in MediaBrowser - Stack ...
My audio streaming app have this issue in Crashlytics, with the stacktrace ... IllegalStateException: getExtras() called while not connected ...
Read more >Server crash at startup - Linux - Emby Community
I get the following error: 2016-10-31 19:06:18.6321 Info ConnectManager: Loading data from /var/lib/emby-server/data/connect.txt 2016-10-31 ...
Read more >Diff - platform/packages/apps/Car/Media
Prompt text to display when we failed to connect to a media app. ... mController has been disconnected before we call MediaBrowser.connect() -...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use this code in try catch block.
I have also encounter this problem。How can i get the connect state,and i want use connect state avoid this crash。 Examle: if(mediaBrowser.getConnectState() != CONNECT_STATE_CONNECTING && !mediaBrowser.isConnected){ mediaBrowser.connect() }