长按文本视图提示时,应用崩溃

时间:2018-09-25 11:37:06

标签: java android exception

我的应用程序中有一个文本视图,只要我长按“文本视图”的提示,应用程序就会崩溃。我不知道为什么。

LogCat:

2018-09-25 17:02:39.171 25737-25737/com.domain.app D/ViewRootImpl@2f6e516[MainActivity]: ViewPostImeInputStage processPointer 0
2018-09-25 17:02:39.174 25737-25737/com.domain.app W/System: ClassLoader referenced unknown path: /system/framework/QPerformance.jar
2018-09-25 17:02:39.175 25737-25737/com.domain.app E/BoostFramework: BoostFramework() : Exception_1 = java.lang.ClassNotFoundException: Didn't find class "com.qualcomm.qti.Performance" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib64, /vendor/lib64]]
2018-09-25 17:02:39.175 25737-25737/com.domain.app V/BoostFramework: BoostFramework() : mPerf = null
2018-09-25 17:02:39.678 25737-25737/com.domain.app D/TextView: performLongClick() is called
2018-09-25 17:02:39.687 25737-25737/com.domain.app D/TextView: handled is false
2018-09-25 17:02:39.745 25737-25737/com.domain.app E/ClipboardServiceEx: clipEx is com.samsung.android.content.clipboard.SemClipboardManager@fdc3f2f
2018-09-25 17:02:39.859 25737-25737/com.domain.app D/AbsListView: Get MotionRecognitionManager
2018-09-25 17:02:39.865 25737-25737/com.domain.app D/MotionRecognitionManager: mSContextService = com.samsung.android.hardware.context.ISemContextService$Stub$Proxy@6d8cca4
2018-09-25 17:02:39.867 25737-25737/com.domain.app D/MotionRecognitionManager: motionService = com.samsung.android.gesture.IMotionRecognitionService$Stub$Proxy@3814a0d
2018-09-25 17:02:39.867 25737-25737/com.domain.app D/MotionRecognitionManager: motionService = com.samsung.android.gesture.IMotionRecognitionService$Stub$Proxy@3814a0d
2018-09-25 17:02:39.893 25737-25737/com.domain.app E/InputEventReceiver: Exception dispatching input event.
2018-09-25 17:02:39.893 25737-25737/com.domain.app D/AndroidRuntime: Shutting down VM


    --------- beginning of crash
2018-09-25 17:02:39.895 25737-25737/com.domain.app E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.domain.app, PID: 25737
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.widget.Editor$SelectionModifierCursorController.isDragAcceleratorActive()' on a null object reference
        at android.widget.Editor.updateFloatingToolbarVisibility(Editor.java)
        at android.widget.Editor.onTouchEvent(Editor.java)
        at android.widget.TextView.onTouchEvent(TextView.java)
        at android.view.View.dispatchTouchEvent(View.java)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java)
        at android.app.Activity.dispatchTouchEvent(Activity.java)
        at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
        at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java)
        at android.view.View.dispatchPointerEvent(View.java)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java)
        at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
        at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java)
        at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java)
        at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java)
        at android.view.Choreographer.doCallbacks(Choreographer.java)
        at android.view.Choreographer.doFrame(Choreographer.java)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java)
        at android.os.Handler.handleCallback(Handler.java)
        at android.os.Handler.dispatchMessage(Handler.java)
2018-09-25 17:02:39.895 25737-25737/com.domain.app E/AndroidRuntime:     at android.os.Looper.loop(Looper.java)
        at android.app.ActivityThread.main(ActivityThread.java)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)

这里似乎是什么问题?

1 个答案:

答案 0 :(得分:1)

结果这是三星特有的问题

对我来说,解决方案是禁用对元素android:longClickable="false" 的长按(我可以负担得起)。如果您不想禁用所有设备的长按,则可能只需要禁用三星的设备即可。

请参阅此文章以仅对Samsung设备阻止长按: java.lang.NullPointerException with Nougat