検索窓とか作るときに、デフォルトで検索エリアにフォーカスを当てたくない場合の対応
1.layout.xmlの設定
<EditText android:id="@+id/searchBar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="地図を検索" android:focusable="false"/>
android:focusable=”false”がポイント!
2.Activityの設定
layoutの調整だけだと、タップ時にフォーカスが当たらないので
EditText txtTitle = findById(R.id.searchBar); txtTitle.setFocusable(true); txtTitle.setFocusableInTouchMode(true);