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() {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||
checkInternet();
|
||||
}
|
||||
});
|
||||
getMainHandler().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||
checkInternet();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -3658,16 +3658,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
}
|
||||
|
||||
private void check() {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||
if (!rvMessage.isComputingLayout())
|
||||
adapter.checkInternet();
|
||||
}
|
||||
});
|
||||
getMainHandler().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||
if (!rvMessage.isComputingLayout())
|
||||
adapter.checkInternet();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@ import android.widget.Toast;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
|
@ -295,11 +294,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
|||
};
|
||||
|
||||
private void showConnectionType() {
|
||||
FragmentActivity activity = getActivity();
|
||||
if (activity == null)
|
||||
return;
|
||||
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
getMainHandler().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
|
||||
|
|
Loading…
Reference in New Issue