2

I have a alert view with custom layout which contains EditText

activity.alert {
        var quantityEt: EditText? = null

        customView {
            linearLayout {
                orientation = LinearLayout.VERTICAL

                quantityEt = editText {}

                quantityEt!!.requestFocus()
                Log.e("LOL", ac.window.currentFocus.toString())
            }
        }
    }.show()

then I request focus to this edit text. However, activity.window.currentFocus outputs that the currentFocus android.support.v7.widget.RecyclerView.

I need the currentFocus to be EditText. I also tried to tap it to request focus, but still got RecyclerView.

Is there a way to achieve that?

Rustam Ibragimov
  • 2,571
  • 7
  • 22
  • 33
  • Check https://stackoverflow.com/questions/12997273/alertdialog-with-edittext-open-soft-keyboard-automatically-with-focus-on-editte – Rahul Aug 05 '17 at 08:17
  • 1
    @Rahul, it is not the same. I create EditText in alert view as part of custom view. In this question they created edit text outside. – Rustam Ibragimov Aug 05 '17 at 09:20

0 Answers0