VideoPlayerManager icon indicating copy to clipboard operation
VideoPlayerManager copied to clipboard

java.lang.RuntimeException: this should be called in Main Thread at

Open yoonusc opened this issue 7 years ago • 3 comments

Process: com.volokh.danylo.videolist, PID: 32200 java.lang.RuntimeException: this should be called in Main Thread at com.volokh.danylo.video_player_manager.ui.MediaPlayerWrapper.onVideoSizeChanged(MediaPlayerWrapper.java:214) at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:4701) at android.os.Handler.dispatchMessage(Handler.java:106)

yoonusc avatar Dec 17 '18 17:12 yoonusc

same issue @yoonusc do you have any fix or any other alternate?

prasad456 avatar Jul 20 '19 07:07 prasad456

I have same issue: Process: com.qk365.thweeks, PID: 15108 java.lang.RuntimeException: this should be called in Main Thread at com.volokh.danylo.video_player_manager.ui.MediaPlayerWrapper.onVideoSizeChanged(MediaPlayerWrapper.java:214) at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:3402) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:6701) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:249) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)

change this: MediaPlayerWrapper private boolean inUiThread() { // return Thread.currentThread().getId() == 1; return Thread.currentThread() == Looper.getMainLooper().getThread(); }

fangood avatar Aug 05 '19 02:08 fangood

Change the method inUiThread() to the below code.

private boolean inUiThread() { return Looper.myLooper() == Looper.getMainLooper(); }

ghost avatar Aug 14 '19 10:08 ghost