androidのTextViewでフォーカスを有効にしようと思ったけど、うまく行かなかったのでメモ。
xmlで普通に↓「focusable」をtrueにすればいいだけかと思っていたらうまく行かなかった。
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="てきすと" android:focusable="true" />
↓のように「focusable」と「focusableInTouchMode」をtrueにするとうまく行った。
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="てきすと" android:focusable="true" android:focusableInTouchMode="true" />
「focusableInTouchMode」はTouchモード時にViewがフォーカスを取得可能か設定するオプションとのこと。