EditText를 삭제하기위한 클리어 버튼이 있습니다.버튼을 누른 후 키보드 표시
public void clearEtSearch(View v) {
etSearch.setText("");
etSearch.requestFocus();
showKeyboard(etSearch);
}
내가 숨어와 키보드를 표시하도록 변경에서 아래의 코드를 촬영했다,하지만 내가 뭘 잘못
private void showKeyboard(View view) {
InputMethodManager manager = (InputMethodManager) view.getContext()
.getSystemService(INPUT_METHOD_SERVICE);
if (manager != null)
manager.showSoftInputFromInputMethod(view.getWindowToken(), 0);
}
을 작동하지 않습니다 :
<Button
android:id="@+id/bClearText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_marginRight="10dp"
android:onClick="clearEtSearch"
android:background="@drawable/delete" />
이 방법
은 글고 치기가 해제? 제 코드를 수정 해주십시오.