blob: be9f5bf4d17d9e3015a89667513ab543d7506281 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package com.wireguard.android;
import android.app.Activity;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.preference.PreferenceFragment;
public class SettingsActivity extends Activity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final FragmentTransaction transaction = getFragmentManager().beginTransaction();
final Bundle args = new Bundle();
args.putBoolean("showQuickTile", getIntent().getBooleanExtra("showQuickTile", false));
final SettingsFragment fragment = new SettingsFragment();
fragment.setArguments(args);
transaction.replace(android.R.id.content, fragment).commit();
}
public static class SettingsFragment extends PreferenceFragment {
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
if (getArguments().getBoolean("showQuickTile"))
((ConfigListPreference) findPreference("primary_config")).show();
}
}
}
|