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

NPE when scrolling recyclerview #2

Description

@jcholin

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" />

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions