Fix crash when clicking on notification on some devices
This commit is contained in:
parent
4dbea26ff8
commit
6be8df9ff8
3 changed files with 9 additions and 3 deletions
|
@ -189,7 +189,9 @@ public class ChatCreationFragment extends Fragment implements View.OnClickListen
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
|
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
|
||||||
inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
|
if (getActivity().getCurrentFocus() != null) {
|
||||||
|
inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -223,7 +223,9 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
|
||||||
// Force hide keyboard
|
// Force hide keyboard
|
||||||
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
||||||
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
|
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
|
||||||
inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
|
if (getActivity().getCurrentFocus() != null) {
|
||||||
|
inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
initChatRoom();
|
initChatRoom();
|
||||||
displayChatRoomHeader();
|
displayChatRoomHeader();
|
||||||
|
|
|
@ -312,7 +312,9 @@ public class GroupInfoFragment extends Fragment implements ChatRoomListener {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
|
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
|
||||||
inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
|
if (getActivity().getCurrentFocus() != null) {
|
||||||
|
inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue