概要
Androidでアプリ作成時にアプリ起動時にEditTextにフォーカスがデフォルトであたっていた。
そのため、特定の端末ではアプリ起動時にキーボードが表示されてしまうという現象が発生した。
この現象を修正するために行った、起動時にEditTextにフォーカスがあたらないようにする方法を記載する。
アプリを作成する際に使用していた言語はKotlin
アプリ起動時にEditTextにフォーカスがあたらないようにする方法
AndroidのLayoutのxmlでEditTextの親のレイアウトに以下のコードを追加する。
こうすることでアプリ起動時にEditTextにフォーカスはあたらなくなる。
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"