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

RecyclerView Gone #46

Closed
sundar-malya opened this issue Nov 3, 2017 · 7 comments
Closed

RecyclerView Gone #46

sundar-malya opened this issue Nov 3, 2017 · 7 comments

Comments

@sundar-malya
Copy link

sundar-malya commented Nov 3, 2017

  1. I have implemented swipe to refresh and whenever i swipe from top 3 to 4 times the recyclerview will be gone the whole view become blank

  2. Sometimes i got the below error and app will crash:-
    UncaughtException: java.lang.OutOfMemoryError: Could not allocate JNI Env
    at java.lang.Thread.nativeCreate(Native Method)
    at java.lang.Thread.start(Thread.java:745)
    at com.allattentionhere.autoplayvideos.AAH_CustomRecyclerView.playAvailableVideos(AAH_CustomRecyclerView.java:91)
    at com.allattentionhere.autoplayvideos.AAH_CustomRecyclerView$1.onScrollStateChanged(AAH_CustomRecyclerView.java:76)
    at android.support.v7.widget.RecyclerView.dispatchOnScrollStateChanged(RecyclerView.java:4655)
    at android.support.v7.widget.RecyclerView.setScrollState(RecyclerView.java:1386)
    at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4791)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:926)
    at android.view.Choreographer.doCallbacks(Choreographer.java:735)
    at android.view.Choreographer.doFrame(Choreographer.java:664)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:912)
    at android.os.Handler.handleCallback(Handler.java:761)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:156)
    at android.app.ActivityThread.main(ActivityThread.java:6523)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)

@Krupen
Copy link
Owner

Krupen commented Nov 5, 2017

For 1st problem, try resetting the adapter when swipe refresh, or even try removing all items from adapter list and adding them again on swipe refresh and also call notifyDataSetChanged().

For 2nd problem, there could be many reasons for OutOfMemory errors, I could help more if you share some code reproducing the behaviour. Also could be just due to very large videos and low RAM on device.

@sundar-malya
Copy link
Author

thank you for the solution

@Krupen Krupen closed this as completed Nov 6, 2017
@sundar-malya
Copy link
Author

I have used stopVideos() method in onPause() when i redirect from current activity to new activity, but the issue is video sound not stop when new activity started in some devices

@Krupen Krupen reopened this Nov 6, 2017
@Krupen
Copy link
Owner

Krupen commented Nov 6, 2017

I tested it on Moto E device and it worked well. However, I am calling recyclerView.stopVideos() in onStop()

@sundar-malya
Copy link
Author

ok i have one plus device with android version 7.0 and used the same method but still the sound play

@Krupen
Copy link
Owner

Krupen commented Nov 6, 2017

I don't have a physical device with Android 7.0. However I have created another branch with name soundfix. Please pull that branch and try it.

@Krupen
Copy link
Owner

Krupen commented Nov 17, 2017

I hope the issue is fixed, feel free to re-open this issue if it is not solved.

@Krupen Krupen closed this as completed Nov 17, 2017
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