mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 14:11:00 +00:00
Prevent crash
This commit is contained in:
parent
9221de9f28
commit
21242a4e1a
2 changed files with 20 additions and 14 deletions
|
@ -20,6 +20,7 @@ package eu.faircode.email;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -524,13 +525,15 @@ public class FragmentCompose extends FragmentEx {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void check() {
|
private void check() {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
Activity activity = getActivity();
|
||||||
@Override
|
if (activity != null)
|
||||||
public void run() {
|
activity.runOnUiThread(new Runnable() {
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
@Override
|
||||||
checkInternet();
|
public void run() {
|
||||||
}
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||||
});
|
checkInternet();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ package eu.faircode.email;
|
||||||
Copyright 2018 by Marcel Bokhorst (M66B)
|
Copyright 2018 by Marcel Bokhorst (M66B)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -1396,13 +1397,15 @@ public class FragmentMessages extends FragmentEx {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void check() {
|
private void check() {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
Activity activity = getActivity();
|
||||||
@Override
|
if (activity != null)
|
||||||
public void run() {
|
activity.runOnUiThread(new Runnable() {
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
@Override
|
||||||
adapter.checkInternet();
|
public void run() {
|
||||||
}
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||||
});
|
adapter.checkInternet();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue