mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-31 20:25:38 +00:00
Prevent crash
This commit is contained in:
parent
f00427136b
commit
fba29ddbdd
1 changed files with 9 additions and 2 deletions
|
@ -55,6 +55,7 @@ import androidx.cardview.widget.CardView;
|
|||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.view.MenuCompat;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -748,7 +749,7 @@ public class FragmentSetup extends FragmentBase {
|
|||
view.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
tvNoInternet.setVisibility(View.GONE);
|
||||
updateInternet(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -758,10 +759,16 @@ public class FragmentSetup extends FragmentBase {
|
|||
view.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
tvNoInternet.setVisibility(View.VISIBLE);
|
||||
updateInternet(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateInternet(boolean available) {
|
||||
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||
return;
|
||||
tvNoInternet.setVisibility(available ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
};
|
||||
|
||||
public static class FragmentDialogDoze extends FragmentDialogBase {
|
||||
|
|
Loading…
Reference in a new issue