こんにちは。 今回はAndroidのフォーカスについてです。 画面起動後、EditTextなどにフォーカスを自動で当てたりしたいときがあります。 その方法を今回はメモしておきます。 起動後にEditTextにフォーカスを当てる 早速コードです。 レイアウトファイルで定義していきます。 <EditText android:id=”@+id/EditText01″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” > <requestFocus/> </EditText> フォーカスを当てておきたいViewに、を指定するだけです。 簡単ですね。 起動後にEditTextにフォーカスを当てない(違うViewに当てる) 今度は、逆に起動後にEditTextにフォーカスを当てない方法です。 起動後にフォー