mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-10 21:25:07 +01:00
34 lines
1.1 KiB
Java
34 lines
1.1 KiB
Java
|
package gq.cyuubi.lightswitch;
|
||
|
|
||
|
import android.os.Bundle;
|
||
|
|
||
|
import androidx.appcompat.app.ActionBar;
|
||
|
import androidx.appcompat.app.AppCompatActivity;
|
||
|
import androidx.appcompat.widget.Toolbar;
|
||
|
import androidx.preference.PreferenceFragmentCompat;
|
||
|
|
||
|
public class SettingsActivity extends AppCompatActivity {
|
||
|
|
||
|
@Override
|
||
|
protected void onCreate(Bundle savedInstanceState) {
|
||
|
super.onCreate(savedInstanceState);
|
||
|
setContentView(R.layout.settings_activity);
|
||
|
getSupportFragmentManager()
|
||
|
.beginTransaction()
|
||
|
.replace(R.id.settings, new HeaderFragment())
|
||
|
.commit();
|
||
|
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
|
||
|
ActionBar actionBar = getSupportActionBar();
|
||
|
if (actionBar != null) {
|
||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static class HeaderFragment extends PreferenceFragmentCompat {
|
||
|
@Override
|
||
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||
|
setPreferencesFromResource(R.xml.preferences, rootKey);
|
||
|
}
|
||
|
}
|
||
|
}
|