在目前布局檔案裡添加一個TextView控件
<TextView
android:id="@+id/config_hidden"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true" />
在Activity裡添加
TextView config_hidden = (TextView) this.findViewById(R.id.config_hidden);
config_hidden.requestFocus();
轉載于:https://www.cnblogs.com/yangcong/p/3289329.html