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

NullPointerException on LongClick in Edittext #186

Open
9to6 opened this issue Jun 5, 2015 · 1 comment
Open

NullPointerException on LongClick in Edittext #186

9to6 opened this issue Jun 5, 2015 · 1 comment

Comments

@9to6
Copy link

9to6 commented Jun 5, 2015

  1. add header view

<EditText
    android:id="@+id/txt_title"
    android:layout_width="match_parent"
    android:layout_height="48dp"
    android:layout_weight="1"
    android:gravity="center" />

image

  1. Long Click in EditText
  2. throw Exception.

java.lang.NullPointerException
at android.widget.AbsListView.showContextMenuForChild(AbsListView.java:2891)
at android.view.ViewGroup.showContextMenuForChild(ViewGroup.java:647)
at android.view.ViewGroup.showContextMenuForChild(ViewGroup.java:647)
at android.view.View.showContextMenu(View.java:4310)
at android.view.View.performLongClick(View.java:4279)
at android.widget.TextView.performLongClick(TextView.java:8250)
at android.view.View$CheckForLongPress.run(View.java:17700)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)

my env
ANDROID_BUILD_MIN_SDK_VERSION=15
ANDROID_BUILD_TARGET_SDK_VERSION=21
ANDROID_BUILD_TOOLS_VERSION=21.1.2
ANDROID_BUILD_SDK_VERSION=21

thz~

@rajtrivedi88
Copy link

I got the same issue.I could fix this by setting font of the view(Editext/Textview) programmatically instead of XML.Please note that for me it was only happening on lollipop versions of Samsung reported by crashlytics.

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