解决办法:在EditText所在的父布局中添加两行
<LinearLayout android:focusable="true" android:focusableInTouchMode"true"/>
<LinearLayout android:focusable="true" android:focusableInTouchMode"true"/>