java.lang.NullPointerException:尝试调用虚拟方法'void android.widget.Editor $ SelectionModifierCursorController.show()' [英] java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Editor$SelectionModifierCursorController.show()'

查看:152
本文介绍了java.lang.NullPointerException:尝试调用虚拟方法'void android.widget.Editor $ SelectionModifierCursorController.show()'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Crashlytics上有一个异常,该异常未在堆栈跟踪中显示我的任何代码,我如何确定是什么原因引起的?似乎仅在Android 5.0和5.0.1上发生.我正在使用23.4支持库.

I have an exception on Crashlytics that doesn't show any of my code on the stack trace, how can I figure out what is causing it? Seems to be happening exclusively on Android 5.0 and 5.0.1. I am using the support library 23.4.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Editor$SelectionModifierCursorController.show()' on a null object reference
       at android.widget.Editor$SelectionActionModeCallback.onCreateActionMode(Editor.java:3023)
       at com.android.internal.policy.impl.PhoneWindow$DecorView$ActionModeCallbackWrapper.onCreateActionMode(PhoneWindow.java:3163)
       at android.support.v7.view.SupportActionModeWrapper$CallbackWrapper.onCreateActionMode(SupportActionModeWrapper.java:155)
       at android.support.v7.app.AppCompatDelegateImplV7$ActionModeCallbackWrapperV7.onCreateActionMode(AppCompatDelegateImplV7.java:1742)
       at android.support.v7.app.AppCompatDelegateImplV7.startSupportActionModeFromWindow(AppCompatDelegateImplV7.java:802)
       at android.support.v7.app.AppCompatDelegateImplV7.startSupportActionMode(AppCompatDelegateImplV7.java:696)
       at android.support.v7.app.AppCompatDelegateImplV14$AppCompatWindowCallbackV14.startAsSupportActionMode(AppCompatDelegateImplV14.java:187)
       at android.support.v7.app.AppCompatDelegateImplV14$AppCompatWindowCallbackV14.onWindowStartingActionMode(AppCompatDelegateImplV14.java:171)
       at android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode(WindowCallbackWrapper.java:145)
       at com.android.internal.policy.impl.PhoneWindow$DecorView.startActionMode(PhoneWindow.java:2644)
       at com.android.internal.policy.impl.PhoneWindow$DecorView.startActionModeForChild(PhoneWindow.java:2631)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:694)
       at android.view.View.startActionMode(View.java:4857)
       at android.widget.Editor.startSelectionActionMode(Editor.java:1626)
       at android.widget.Editor.performLongClick(Editor.java:914)
       at android.widget.TextView.performLongClick(TextView.java:8900)
       at android.view.View$CheckForLongPress.run(View.java:19735)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5253)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

报告崩溃的用户想出了如何重现崩溃的方法.当他使用我的AppCompatAutoCompleteTextView选择所有文本并将其复制到剪贴板时,就会发生这种情况.它仅在Android 5.0和5.0.1上发生

A user who reported the crash figured out how to reproduce it. It happens when he uses my AppCompatAutoCompleteTextView to select all the text and copy it to the clipboard. It only happens on Android 5.0 and 5.0.1

我认为它不仅在Android 5上发生,而且stacktrace看起来也是如此,以至于Crashlytics并未对其进行分组.根据一些帖子,我发现我认为它与上下文操作栏的高度或它的计算方式有关,但是我还没有找到明确的答案.

I think it is happening on more than just Android 5 but the stacktrace looks different enough that Crashlytics doesn't group it. Based on some posts I found I think it has to do with the Contextual Actionbar height or how it calculates it but I haven't found a clear answer yet.

推荐答案

我有一个AppCompatAutoCompleteTextView,当它聚焦时会改变大小.事实证明,当它处于折叠大小时,当onFocusChange事件触发时,用户长按它时,整个事件将发生变化,并且将崩溃.

I have a AppCompatAutoCompleteTextView that changes size when it is on focus. Turns out users were long pressing on it while it was on the collapsed size and when the onFocusChange event fired the whole thing would change and it would crash.

这篇关于java.lang.NullPointerException:尝试调用虚拟方法'void android.widget.Editor $ SelectionModifierCursorController.show()'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆