From 08b40e81c62420e977e82189482fc07c0d6ace31 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 14 May 2023 23:00:00 +0200 Subject: menu / settings --- app/java/src/SettingsActivity.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'app/java/src/SettingsActivity.java') 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); + } + } } -- cgit v1.2.3