question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Got an error when invoke the start method in ViewHolder

See original GitHub issue
java.lang.IllegalStateException: Handler (android.os.Handler) {ed82dba} sending message to a Handler on a dead thread
            at android.os.MessageQueue.enqueueMessage(MessageQueue.java:325)
            at android.os.Handler.enqueueMessage(Handler.java:631)
            at android.os.Handler.sendMessageAtTime(Handler.java:600)
            at android.os.Handler.sendMessageDelayed(Handler.java:570)
            at android.os.Handler.sendMessage(Handler.java:507)
            at android.os.Message.sendToTarget(Message.java:416)
            at com.google.android.exoplayer.ExoPlayerImplInternal.prepare(ExoPlayerImplInternal.java:132)
            at com.google.android.exoplayer.ExoPlayerImpl.prepare(ExoPlayerImpl.java:99)
            at com.devbrackets.android.exomedia.exoplayer.EMExoPlayer.onRenderers(EMExoPlayer.java:285)
            at com.devbrackets.android.exomedia.exoplayer.EMExoPlayer$InternalRendererBuilderCallback.onRenderers(EMExoPlayer.java:601)
            at com.devbrackets.android.exomedia.builder.RenderBuilder.buildRenderers(RenderBuilder.java:95)
            at com.devbrackets.android.exomedia.exoplayer.EMExoPlayer.prepare(EMExoPlayer.java:246)
            at com.devbrackets.android.exomedia.exoplayer.EMExoPlayer.replaceRenderBuilder(EMExoPlayer.java:146)
            at com.devbrackets.android.exomedia.EMVideoView.setVideoURI(EMVideoView.java:642)
            at com.devbrackets.android.exomedia.EMVideoView.setVideoURI(EMVideoView.java:624)
mTitle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mEmVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                    @Override
                    public void onPrepared(MediaPlayer mp) {
                        mEmVideoView.start();
                    }
                });
                mEmVideoView.setVideoURI(Uri.parse("http://.....................mp4"));
            }
        });

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
brianwernickcommented, Nov 7, 2015

I’ve added a method to allow disabling the releasing of resources in onDetachedFromWindow() https://github.com/brianwernick/ExoMedia/commit/ac950d9d6a21a24116482b6dd0fe57b4558ebeb9.

On the other topic; I understand that there are many other libraries out there the handle a much broader range of devices. My main focus for this library was to simplify interaction with the ExoPlayer which isn’t supported on many devices (usually if they don’t have the Play Store then they don’t pass the CTS and therefore don’t support the ExoPlayer).

Thanks for the interesting discussion, but since I have added a solution I will close the bug.

1reaction
eneimcommented, Oct 5, 2015

Hm I’m working on the same thing with @daimajia . It turns out that your EMVideoView will release the exoPlayer in onDetachedFromWindow, therefore the VideoView will no longer be useable after that point. Don’t have any good idea for this now, but please consider to improve this 😄. Is that safe to not release the player after the view got detached? I deeply understand that it may cause the memory leak of the Player, we can think about this for a better solution. Best Regards!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to call method in Adapter from ViewHolder ...
You're trying to call delete from the view holder class. But delete is a method of the adapter class. You can may be...
Read more >
HourAdapter Error "Attempt to invoke method '...' on a null ...
Hi John,. This is being caused by the setText method failing as it is being called on a null object. So, mTemperatureLabel is...
Read more >
Using the RecyclerView | CodePath Android Cliffnotes
You may notice an error that says "There is no default constructor available in androidx.recyclerview.widget.ListAdapter ". The reason is that you will declare ......
Read more >
Calling NotifyAll to Update RecyclerView from External Method
I have a RecyclerView (with an Adapter, ViewHolder, etc.), and I need to update the data (the IEnumerable passed to the Adapter).
Read more >
[Resolved] attempt to invoke virtual method recyclerview ...
You have declared RecyclerView recyclerView; in your class, but you have not initialised it before trying to use it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found