when i click on edit boxes softkeyboard is displaying.but it is not hiding when edit boxes lose the focus.i am using fragments in my app.i have tried the below code to hide the keyborad.
public void onActivityCreated(Bundle arg0) {
super.onActivityCreated(arg0);
_context = this.getActivity();
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null)
imm.hideSoftInputFromWindow(getView().getWindowToken(), 0);
}
but app is crashing intermittently.logcat error is given below.
05-04 18:22:15.540: E/AndroidRuntime(8152): java.lang.IllegalStateException: Recursive entry to executePendingTransactions
05-04 18:22:15.540: E/AndroidRuntime(8152): at android.support.v4.app.FragmentManagerImpl.execPendingActions(Unknown Source)
05-04 18:22:15.540: E/AndroidRuntime(8152): at android.support.v4.app.FragmentManagerImpl$1.run(Unknown Source)
please anybody help me to do this…
i dont know why it was crashing.but i found another way of implementation.this is the code