mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-18 21:28:54 +00:00
Prevent crash
This commit is contained in:
parent
6e54c67429
commit
b80f7db3cb
1 changed files with 6 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue