//定焦点定焦点到字符串最后面
CharSequence query = et_loc_qhis_query.getText();
if (query instanceof Spannable) {
Spannable spanText = (Spannable)query;
Selection.setSelection(spanText, query.length());
}
//搜索时隐藏键盘
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(et_loc_qhis_query.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
//限制字符个数
android:maxLength="16"
或
editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(10)});