audio-waveform
audio-waveform copied to clipboard
Crashes on using WaveformView in a RecyclerView
CrashLog:
java.lang.NullPointerException: Attempt to read from null array
at com.github.derlio.waveform.WaveformView.onDraw(WaveformView.java:384)
at android.view.View.draw(View.java:17099)
at android.view.View.updateDisplayListIfDirty(View.java:16081)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3750)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3730)
at android.view.View.updateDisplayListIfDirty(View.java:16044)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3750)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3730)
at android.view.View.updateDisplayListIfDirty(View.java:16044)
at android.view.View.draw(View.java:16865)
at android.view.ViewGroup.drawChild(ViewGroup.java:3766)
at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:4820)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3552)
at android.view.View.draw(View.java:17102)
at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4219)
at android.view.View.updateDisplayListIfDirty(View.java:16081)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3750)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3730)
at android.view.View.updateDisplayListIfDirty(View.java:16044)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3750)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3730)
at android.view.View.updateDisplayListIfDirty(View.java:16044)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3750)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3730)
at android.view.View.updateDisplayListIfDirty(View.java:16044)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3750)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3730)
at android.view.View.updateDisplayListIfDirty(View.java:16044)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3750)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3730)
at android.view.View.updateDisplayListIfDirty(View.java:16044)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3750)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3730)
at android.view.View.updateDisplayListIfDirty(View.java:16044)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:666)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:672)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:780)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2840)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2648)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2255)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1290)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6399)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:873)
at android.view.Choreographer.doCallbacks(Choreographer.java:685)
at android.view.Choreographer.doFrame(Choreographer.java:621)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:859)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:165)
at android.app.ActivityThread.main(ActivityThread.java:6375)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
This does not seem to be a problem with SimpleWaveformView
but it does not allow setting the Sound file asynchronously.