Fix crash when clicking on notification on some devices

This commit is contained in:
Sylvain Berfini 2018-03-13 10:14:15 +01:00
parent 4dbea26ff8
commit 6be8df9ff8
3 changed files with 9 additions and 3 deletions

View file

@ -189,8 +189,10 @@ public class ChatCreationFragment extends Fragment implements View.OnClickListen
super.onResume();
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
if (getActivity().getCurrentFocus() != null) {
inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
}
}
@Override
public void onPause() {

View file

@ -223,7 +223,9 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
// Force hide keyboard
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
if (getActivity().getCurrentFocus() != null) {
inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
}
initChatRoom();
displayChatRoomHeader();

View file

@ -312,8 +312,10 @@ public class GroupInfoFragment extends Fragment implements ChatRoomListener {
super.onResume();
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
if (getActivity().getCurrentFocus() != null) {
inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
}
}
@Override
public void onPause() {