Activity/Fragment 含 `EditText`,啟動時鍵盤彈出、光標閃爍,體驗不佳。
<LinearLayout xmlns:android="https://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:focusable="true"
android:focusableInTouchMode="true">
<EditText
android:id="@+id/et_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="請輸入" />
</LinearLayout>
// 在 onCreate / onViewCreated 中
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); // 隱藏鍵盤
rootView.requestFocus(); // 手動請求焦點給根佈局