Fixed crash in settings

This commit is contained in:
PeratX 2017-05-10 06:04:10 +08:00
parent 67840ca06a
commit 5a9c8ba51b

View File

@ -6,7 +6,9 @@ import android.os.Build;
import android.os.Bundle;
import android.preference.*;
import android.support.design.widget.Snackbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import org.itxtech.daedalus.Daedalus;
import org.itxtech.daedalus.R;
import org.itxtech.daedalus.util.DnsServerHelper;
@ -109,6 +111,12 @@ public class SettingsFragment extends PreferenceFragment {
updateAdvancedOptions(advanced.isChecked());
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = super.onCreateView(inflater, container, savedInstanceState);
return view;
}
private void updateAdvancedOptions(boolean checked) {
PreferenceCategory category = (PreferenceCategory) findPreference("settings_advanced");
for (int i = 1; i < category.getPreferenceCount(); i++) {