0

Try stacking two fragments with editTexts on top of each other using an Add Transaction. after that when you press the keyboard imeOption key next button the bottom fragment's edit text can gain focus. this is a security concern. user can type things into the bottom fragments edit text (blindly). I tried the following code:

android:filterTouchesWhenObscured="true" 

but it has not helped at least on api 27.

my edit text itself looks like this, nothing special:

                                <EditText
                                    android:id="@+id/et"
                                    android:layout_width="195dp"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentBottom="true"
                                    android:imeOptions="actionNone"
                                    android:layout_marginBottom="10dp"
                                    android:hint="@string/enter_name"
                                    android:filterTouchesWhenObscured="true"
                                    android:inputType="textNoSuggestions"
                                    android:textColorHint="#959595"
                                    android:textSize="11sp" />

the issue is very similar to android tap jacking

i tried even doing this:

android:nextFocusDown="@+id/et_two" thinking it would bypass and go directly to the edittext i want. but instead the bottom edit text still gains focus.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
j2emanue
  • 60,549
  • 65
  • 286
  • 456

1 Answers1

0

the issue solution was surprising. recyclerview was stealing focus. see this SO incident:

adding android:descendantFocusability="blocksDescendants" to the recyclerview stopped the issue.

j2emanue
  • 60,549
  • 65
  • 286
  • 456