diff options
Diffstat (limited to 'app/java/src/SettingsActivity.java')
-rw-r--r-- | app/java/src/SettingsActivity.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/app/java/src/SettingsActivity.java b/app/java/src/SettingsActivity.java index 83e2661..c71693a 100644 --- a/app/java/src/SettingsActivity.java +++ b/app/java/src/SettingsActivity.java @@ -12,6 +12,10 @@ import android.net.VpnService; import android.os.Bundle; +import android.preference.MultiSelectListPreference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceFragment; + import android.util.Log; import android.view.Menu; @@ -24,13 +28,17 @@ import android.widget.Button; import android.widget.Toast; import android.provider.Settings; -public class SettingsActivity extends Activity { +import java.util.List; + +public class SettingsActivity extends PreferenceActivity { + + private MultiSelectListPreference knownSsids; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.settings); + getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit(); // if (setting.get(USE_WIFI_LISTENER)) // requestPermissions(new String[]{ @@ -38,4 +46,14 @@ public class SettingsActivity extends Activity { // }, 1234); // startService(WifiListenerService); } + + public static class SettingsFragment extends PreferenceFragment { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + addPreferencesFromResource(R.xml.settings); + } + } } |