mirror of https://github.com/M66B/FairEmail.git
Replace runOnUiThread by main handler
This commit is contained in:
parent
33581e907f
commit
6752793a6d
|
@ -1298,15 +1298,13 @@ public class FragmentCompose extends FragmentBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void check() {
|
private void check() {
|
||||||
Activity activity = getActivity();
|
getMainHandler().post(new Runnable() {
|
||||||
if (activity != null)
|
@Override
|
||||||
activity.runOnUiThread(new Runnable() {
|
public void run() {
|
||||||
@Override
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
public void run() {
|
checkInternet();
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
}
|
||||||
checkInternet();
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3658,16 +3658,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
}
|
}
|
||||||
|
|
||||||
private void check() {
|
private void check() {
|
||||||
Activity activity = getActivity();
|
getMainHandler().post(new Runnable() {
|
||||||
if (activity != null)
|
@Override
|
||||||
activity.runOnUiThread(new Runnable() {
|
public void run() {
|
||||||
@Override
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
public void run() {
|
if (!rvMessage.isComputingLayout())
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
adapter.checkInternet();
|
||||||
if (!rvMessage.isComputingLayout())
|
}
|
||||||
adapter.checkInternet();
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,6 @@ import android.widget.Toast;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.widget.SwitchCompat;
|
import androidx.appcompat.widget.SwitchCompat;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
|
||||||
import androidx.lifecycle.Lifecycle;
|
import androidx.lifecycle.Lifecycle;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
|
@ -295,11 +294,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||||
};
|
};
|
||||||
|
|
||||||
private void showConnectionType() {
|
private void showConnectionType() {
|
||||||
FragmentActivity activity = getActivity();
|
getMainHandler().post(new Runnable() {
|
||||||
if (activity == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
activity.runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
|
||||||
|
|
Loading…
Reference in New Issue