安卓子控件失去焦点 不弹出软键盘

当子的EditText失去焦点后,父级的LinearLayout获得了焦点,这样在跳转到该fragment时便不会弹出软键盘

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_drug_baseinfo_fg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_activity_dialog"
android:orientation="vertical"
android:padding="@dimen/dimens_6_160"
android:focusable="true"
android:focusableInTouchMode="true" >

<!-- 药品基本信息 -->

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/dialog_bg_white"
android:orientation="vertical"
android:padding="@dimen/dimens_6_160" >

<!-- 药品名称 -->
<com.hospital.widget.CommonItemValue
android:id="@+id/drug_baseinfo_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:isEditvalue="false"
app:title_textvalue="药品名称" />

<View
style="@style/line_view_stylee_horizontal_fill_gray"
android:layout_marginBottom="@dimen/dimens_3_160"
android:layout_marginTop="@dimen/dimens_3_160" />

<!-- 拼音简码 -->
<com.hospital.widget.CommonItemValue
android:id="@+id/drug_baseinfo_name_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:isEditvalue="false"
app:title_textvalue="拼音简码" />

</LinearLayout>

</LinearLayout>

原文地址:https://www.cnblogs.com/achen0502/p/5466156.html