Android 5 Lollipop compatibility

This commit is contained in:
M66B
2018-12-09 18:49:52 +01:00
parent be415c6a5f
commit ea895040f5
16 changed files with 85 additions and 48 deletions

View File

@@ -19,6 +19,7 @@ package eu.faircode.email;
Copyright 2018 by Marcel Bokhorst (M66B)
*/
import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;
@@ -100,7 +101,7 @@ public class FragmentEx extends Fragment {
public void onDetach() {
super.onDetach();
InputMethodManager im = getContext().getSystemService(InputMethodManager.class);
InputMethodManager im = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
View focused = getActivity().getCurrentFocus();
if (focused != null)
im.hideSoftInputFromWindow(focused.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);