How can I make a custom View subclass focusable by touching it? I'm calling
setFocusable(true);
setFocusableInTouchMode(true);
from the constructor, and an EditText before my control can pass focus to it ("Next" appears instead of "Done" in the soft keyboard), but I need to be able to focus it by tapping on it.
I've seen the solution of setting  android:focusable="true" and android:focusableInTouchMode="true" in the layout XML where it is used, but even that doesn't work.
Solved: needed to call setClickable(true) too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With