Activity_settings_app.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:Kids-Portal-Android 作者:
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    helper_main.setTheme(this);

    setContentView(R.layout.activity_settings);
    helper_main.onStart(Activity_settings_app.this);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    setTitle(R.string.pref_2);

    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);

    android.support.v7.app.ActionBar actionBar = getSupportActionBar();
    if(actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }

    PreferenceManager.setDefaultValues(this, R.xml.user_settings, false);
    PreferenceManager.setDefaultValues(this, R.xml.user_settings_search, false);
    PreferenceManager.setDefaultValues(this, R.xml.user_settings_app, false);
    PreferenceManager.setDefaultValues(this, R.xml.user_settings_close, false);
    PreferenceManager.setDefaultValues(this, R.xml.user_settings_start, false);
    PreferenceManager.setDefaultValues(this, R.xml.user_settings_search_main, false);
    PreferenceManager.setDefaultValues(this, R.xml.user_settings_data, false);
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
    sharedPref.edit().putString("started", "").apply();

    // Display the fragment as the activity_screen_main content
    getFragmentManager().beginTransaction().replace(R.id.content_frame, new SettingsFragment()).commit();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号