我在Google Play控制台中有错误报告。
在此堆栈跟踪中没有找到我的代码的任何一行-因此,我不了解此崩溃的根源。
有谁能够帮助我?
昨天上午6:56在应用程序版本158上
三星Galaxy A50(a50),3840MB RAM,Android 10
报告3之1
java.lang.NullPointerException:
at androidx.core.widget.ListViewAutoScrollHelper.canTargetScrollVertically (ListViewAutoScrollHelper.java:73)
at androidx.core.widget.AutoScrollHelper.shouldAnimate (AutoScrollHelper.java:506)
at androidx.core.widget.AutoScrollHelper.onTouch (AutoScrollHelper.java:485)
at androidx.appcompat.widget.DropDownListView.onForwardedEvent (DropDownListView.java:529)
at androidx.appcompat.widget.ForwardingListener.onTouchForwarded (ForwardingListener.java:276)
at androidx.appcompat.widget.ForwardingListener.onTouch (ForwardingListener.java:97)
at androidx.appcompat.widget.AppCompatSpinner.onTouchEvent (AppCompatSpinner.java:420)
at android.view.View.dispatchTouchEvent (View.java:14376)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3857)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3535)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3863)
at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3551)
at com.android.internal.policy.DecorView.superDispatchTouchEvent (DecorView.java:729)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1922)
at android.app.Activity.dispatchTouchEvent (Activity.java:4051)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent (WindowCallbackWrapper.java:69)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent (WindowCallbackWrapper.java:69)
at com.android.internal.policy.DecorView.dispatchTouchEvent (DecorView.java:687)
at android.view.View.dispatchPointerEvent (View.java:14644)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent (ViewRootImpl.java:6522)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:6309)
at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5747)
at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5800)
at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5766)
at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:5922)
at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5774)
at android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:5979)
at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5747)
at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5800)
at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5766)
at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5774)
at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5747)
at android.view.ViewRootImpl.deliverInputEvent (ViewRootImpl.java:8906)
at android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java:8767)
...
最佳答案
您可以像这样检查您的代码吗?
final ListView list = (ListView) findViewById(android.R.id.list);
final ListViewAutoScrollHelper scrollHelper = new ListViewAutoScrollHelper(list);
scrollHelper.setEnabled(true);
list.setOnTouchListener(scrollHelper);
并发布您的
ListViewAutoScrollHelper
代码