Prevent crash

This commit is contained in:
M66B
2021-09-28 21:15:46 +02:00
parent d69cdbb506
commit 3f228fc559
12 changed files with 57 additions and 7 deletions

View File

@@ -447,13 +447,13 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
getMainHandler().post(new Runnable() {
@Override
public void run() {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
tvNetworkMetered.setText(networkState.isUnmetered() ? R.string.title_legend_unmetered : R.string.title_legend_metered);
tvNetworkInfo.setText(sb.toString());
tvNetworkMetered.setVisibility(networkState.isConnected() ? View.VISIBLE : View.GONE);
tvNetworkRoaming.setVisibility(networkState.isRoaming() ? View.VISIBLE : View.GONE);
cardDebug.setVisibility(sb.length() == 0 ? View.GONE : View.VISIBLE);
}
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
return;
tvNetworkMetered.setText(networkState.isUnmetered() ? R.string.title_legend_unmetered : R.string.title_legend_metered);
tvNetworkInfo.setText(sb.toString());
tvNetworkMetered.setVisibility(networkState.isConnected() ? View.VISIBLE : View.GONE);
tvNetworkRoaming.setVisibility(networkState.isRoaming() ? View.VISIBLE : View.GONE);
cardDebug.setVisibility(sb.length() == 0 ? View.GONE : View.VISIBLE);
}
});
}