Replace runOnUiThread by main handler

This commit is contained in:
M66B
2020-09-17 16:52:19 +02:00
parent 33581e907f
commit 6752793a6d
3 changed files with 16 additions and 25 deletions

View File

@@ -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)) {