이때는 InputMethodManager 를 사용해서 처리하면 된다.
KeyBoard를 보여 줄때=============================================================
public boolean showSoftInput(Viwe view, ResultReveiver resultReceiver)
KeyBoard를 숨길때================================================================
public boolean showSoftInputFromWindow(IBinder windowToken, int flags)
이제 예를 들어 보자면
=================================================================================
private EditText text_edit;
private InputMethodManager imm;
text_edit = (EditText)findViewById(R.id.text_edit);
imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
public void KeyboardHide(){
imm.hideSoftInputFromWindow(text_edit.getWindowToken(),0);
}
public void KeyBoardShow(){
imm.showSoftInput(text_edit, 0);
}
=================================================================================
이렇게 사용하시면 됩니다.
참고적으로 EditText가 있다면 자동으로 포커스가 이동하고 KeyBoard가 표시 됩니다.
이때는 EditText가 있는 Layout에 다음과 같이 추가 해주시면 됩니다.
android:focusable = "true"
android:focusableInTouchMode = "true"