Prevent crash

pull/156/head
M66B 6 years ago
parent 6e54c67429
commit b80f7db3cb

@ -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,11 +2957,12 @@ 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);
(InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null)
imm.showSoftInput(target, InputMethodManager.SHOW_IMPLICIT);
}
}

Loading…
Cancel
Save