The Recyclerview has a ViewHolder that contains TextView typically. The text content is selectable and when long press the text opening a selection menu. The notifyItemChanged function is calling from outside of the Adapter for resize the Textview font. The text selection menu available before resizing but after that the items not selectable. Don't open text selection menu when long press. There are no any request disallowing to event but the issue occurs after the notifyItemChanged.
Edit:
The problem is the TextView xml that item view of the Recyclerview:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/textRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textIsSelectable="true"
android:textSize="15sp" />
The problem is solving if the android:layout_width of TextView is WRAP_CONTENT, but it must be MATCH_PARENT, what does that have to do with anything?
Recyclerview:
<androidx.drawerlayout.widget.DrawerLayout
android:id="@+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.ReadBookActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.drawerlayout.widget.DrawerLayout>
Edit-2:
All of my text content wrapping many spans and there is RelativeSizeSpan for font size. It's editing when changing font size. And notifying the item with notifyItemChanged(i). The problem sametimes don't occuring with using notifyDataSetChanged() withoud using Wrap_Content in the item.
Edit-3: The problem stems from editing RelativeSizeSpan completely, because it's renewing with new size when the changing font size. Removed renewing and it's using Textview.setTextSize() now, no problem.