hanggrian / socialview

Android TextView and EditText with hashtag, mention, and hyperlink support
http://hanggrian.com/socialview/
Apache License 2.0
323 stars 81 forks source link

Crash - Long press on textview with hyperlink. #57

Closed mhrpatel12 closed 3 years ago

mhrpatel12 commented 5 years ago

Getting fatal exception specifically with Xiaomi phones. Xiaomi's Android skin is likely interfering with custom textview, and causing crashes.

Fatal Exception: java.lang.NullPointerException Attempt to invoke virtual method 'int android.widget.Editor$SelectionModifierCursorController.getMinTouchOffset()' on a null object reference android.widget.Editor.touchPositionIsInSelection (Editor.java:1088) android.widget.Editor.performLongClick (Editor.java:1209) android.widget.TextView.performLongClick (TextView.java:10908) android.view.View.performLongClick (View.java:6360) android.view.View$CheckForLongPress.run (View.java:24768) android.os.Handler.handleCallback (Handler.java:790) android.os.Handler.dispatchMessage (Handler.java:99) android.os.Looper.loop (Looper.java:171) android.app.ActivityThread.main (ActivityThread.java:6635) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:547) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:823)

Tried disabling long press but still getting crashes.

Steps to reproduce - Long press on textview which has hyperlink / mention.

hanggrian commented 5 years ago

Will look into this. But having personally dealt with Xiaomi devices myself, I'm afraid there's not much I can/will do if the culprit is indeed their modifications.

mhrpatel12 commented 5 years ago

agree, something is conflicting with mi UI, not sure what. I Don't even have any xiaomi device handy to dive deep into this, all I got is crash reports from crashlytics. :(

hanggrian commented 3 years ago

Unfortunately this issue is impossible to fix without having the device to test, so I'm closing it.