Prevent crash

This commit is contained in:
M66B 2019-06-18 21:12:24 +02:00
parent 6e54c67429
commit b80f7db3cb
1 changed files with 6 additions and 3 deletions

View File

@ -2942,6 +2942,8 @@ public class FragmentCompose extends FragmentBase {
ibReferenceEdit.setVisibility(text[1] == null ? View.GONE : View.VISIBLE);
ibReferenceImages.setVisibility(ref_has_images && !show_images ? View.VISIBLE : View.GONE);
final Context context = getContext();
new Handler().post(new Runnable() {
@Override
public void run() {
@ -2955,12 +2957,13 @@ public class FragmentCompose extends FragmentBase {
target.requestFocus();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean keyboard = prefs.getBoolean("keyboard", true);
if (keyboard) {
InputMethodManager imm =
(InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(target, InputMethodManager.SHOW_IMPLICIT);
(InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null)
imm.showSoftInput(target, InputMethodManager.SHOW_IMPLICIT);
}
}
});