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

java.lang.RuntimeException: cannot be in main thread #113

Open
manegirish opened this issue May 25, 2020 · 1 comment
Open

java.lang.RuntimeException: cannot be in main thread #113

manegirish opened this issue May 25, 2020 · 1 comment

Comments

@manegirish
Copy link

Process: com.volokh.danylo.videolist, PID: 11999
java.lang.RuntimeException: cannot be in main thread
at com.volokh.danylo.video_player_manager.ui.VideoPlayerView.checkThread(VideoPlayerView.java:117)
at com.volokh.danylo.video_player_manager.ui.VideoPlayerView.setOnVideoStateChangedListener(VideoPlayerView.java:288)
at com.volokh.danylo.videolist.video_list_demo.adapter.items.BaseVideoItem.setActive(BaseVideoItem.java:51)
at com.volokh.danylo.visibility_utils.calculator.DefaultSingleItemCalculatorCallback.activateNewCurrentItem(DefaultSingleItemCalculatorCallback.java:28)
at com.volokh.danylo.visibility_utils.calculator.SingleListViewItemActiveCalculator.setCurrentItem(SingleListViewItemActiveCalculator.java:359)
at com.volokh.danylo.visibility_utils.calculator.SingleListViewItemActiveCalculator.calculateMostVisibleItem(SingleListViewItemActiveCalculator.java:189)
at com.volokh.danylo.visibility_utils.calculator.SingleListViewItemActiveCalculator.onScrollStateIdle(SingleListViewItemActiveCalculator.java:159)
at com.volokh.danylo.videolist.video_list_demo.fragments.VideoRecyclerViewFragment$3.run(VideoRecyclerViewFragment.java:145)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7073)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)

@sandeepsinghs
Copy link

Download VideoPlayerManager code and you need to import the VideoManager libs module to your project and comment on the lines inUiThread function call in class MediaPlayerWrapper.

It will work as per expectation.

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

2 participants