一进去Activity,textview 获取焦点

manifest.xml里面的activity设成 android:windowSoftInputMode="stateVisible"




trafficPackageTxt.setFocusable(true);
trafficPackageTxt.requestFocus();
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(trafficPackageTxt, InputMethodManager.SHOW_IMPLICIT);



你可能感兴趣的:(一进去Activity,textview 获取焦点)