SettingsActivity.java 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package eu.kanade.mangafeed.ui.activity;
  2. import android.os.Bundle;
  3. import android.preference.PreferenceFragment;
  4. import android.support.v7.widget.Toolbar;
  5. import butterknife.Bind;
  6. import butterknife.ButterKnife;
  7. import eu.kanade.mangafeed.R;
  8. import eu.kanade.mangafeed.ui.activity.base.BaseActivity;
  9. public class SettingsActivity extends BaseActivity {
  10. @Bind(R.id.toolbar) Toolbar toolbar;
  11. @Override
  12. protected void onCreate(Bundle savedInstanceState) {
  13. super.onCreate(savedInstanceState);
  14. setContentView(R.layout.activity_preferences);
  15. ButterKnife.bind(this);
  16. setupToolbar(toolbar);
  17. getFragmentManager().beginTransaction().replace(R.id.settings_content,
  18. new MyPreferenceFragment()).commit();
  19. }
  20. public static class MyPreferenceFragment extends PreferenceFragment {
  21. @Override
  22. public void onCreate(final Bundle savedInstanceState) {
  23. super.onCreate(savedInstanceState);
  24. addPreferencesFromResource(R.xml.preferences);
  25. }
  26. }
  27. }