Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

NPE when scrolling recyclerview #2

Open
jcholin opened this issue Jan 30, 2018 · 2 comments
Open

NPE when scrolling recyclerview #2

jcholin opened this issue Jan 30, 2018 · 2 comments
Labels

Comments

@jcholin
Copy link

jcholin commented Jan 30, 2018

I have a NPE when scrolling a recyclerview with ExpandableTextView in items

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.text.Layout.getEllipsisCount(int)' on a null object reference
                                                             at tm.charlie.expandabletextview.ExpandableTextView.updateState(ExpandableTextView.kt:349)
                                                             at tm.charlie.expandabletextview.ExpandableTextView.updateState$default(ExpandableTextView.kt:51)
                                                             at tm.charlie.expandabletextview.ExpandableTextView$onTextChanged$1.run(ExpandableTextView.kt:267)
                                                             at android.os.Handler.handleCallback(Handler.java:739)
                                                             at android.os.Handler.dispatchMessage(Handler.java:95)
                                                             at android.os.Looper.loop(Looper.java:234)
                                                             at android.app.ActivityThread.main(ActivityThread.java:5526)
                                                             at java.lang.reflect.Method.invoke(Native Method)
                                                             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Here the layout of the item:

<tm.charlie.expandabletextview.ExpandableTextView
        android:id="@+id/textview_description"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:etv_animationDuration="200"
        app:etv_collapsedLines="3" />
@jcholin
Copy link
Author

jcholin commented Mar 23, 2018

@arslancharyev31 any idea? The bug appears on a OnePlus X, and Sony Xperia

@arslancharyev31
Copy link
Owner

arslancharyev31 commented Mar 25, 2018

@jcholin Honestly, haven't tested it with RecyclerView yet. Would you be kind enough to share your recycler view snippet (if possible, with activity) reproducing the NPE? Are you inflating xml from Java? Kotlin?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants