I added a few EditTextin RecyclerView, because I need to get some values. The implementation is as follows:
<android.support.v7.widget.RecyclerView
android:layout_below="@id/firstrow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
android:descendantFocusability="beforeDescendants"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="@+id/rectable"
android:layout_marginLeft="@dimen/table_margin"
android:layout_marginRight="@dimen/table_margin"
android:layout_marginBottom="300dp" />
and this is custom xml with some EditText:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/white"
android:orientation="horizontal"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="60dp ">
<TextView
android:text="TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/description"
android:layout_weight="1"
android:textColor="@color/black" />
<View
style="@style/VerticalSeparator" />
<EditText
android:hint="lol"
android:id="@+id/weight"
android:focusable="true"
style="@style/DefaultEditCellStyle" />
<View
style="@style/VerticalSeparator" />
<EditText
android:hint="lol"
android:id="@+id/arm"
android:focusable="true"
style="@style/DefaultEditCellStyle" />
<View
style="@style/VerticalSeparator" />
<EditText
android:hint="lol"
android:focusable="true"
android:id="@+id/moment"
style="@style/DefaultEditCellStyle" />
practically, when I click on it EditText, it opens the keyboard, immediately loses focus and closes the keyboard, so it is impossible to write in them. I also tried reading other questions to say the following:
recyclerView.setFocusable(true);
recyclerView.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
recyclerView.setAdapter(adapter);
but with different listviewit does not work.
How can I solve this problem? Thanks you
source
share