wireguard-android/app/src/main/java/com/wireguard/android/activity/SettingsActivity.java

32 lines
952 B
Java
Raw Normal View History

package com.wireguard.android.activity;
import android.app.Activity;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import com.wireguard.android.R;
/**
* Interface for changing application-global persistent settings.
*/
public class SettingsActivity extends Activity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getFragmentManager().findFragmentById(android.R.id.content) == null) {
getFragmentManager().beginTransaction()
.add(android.R.id.content, new SettingsFragment())
.commit();
}
}
public static class SettingsFragment extends PreferenceFragment {
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
}
}
}