cid#1607171 Data race condition
[LibreOffice.git] / android / source / src / java / org / libreoffice / SettingsActivity.java
blobdb715cf8b0cc6d237bde99b5f9371a8abcfde19a
1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9 package org.libreoffice;
11 import android.os.Bundle;
12 import androidx.fragment.app.FragmentActivity;
13 import androidx.preference.PreferenceFragmentCompat;
14 import androidx.preference.PreferenceGroup;
16 public class SettingsActivity extends FragmentActivity {
17 @Override
18 protected void onCreate(Bundle savedInstanceState) {
19 super.onCreate(savedInstanceState);
21 // Display the fragment as the main content.
22 getSupportFragmentManager().beginTransaction()
23 .replace(android.R.id.content, new SettingsFragment())
24 .commit();
27 public static class SettingsFragment extends PreferenceFragmentCompat {
29 @Override
30 public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
31 setPreferencesFromResource(R.xml.libreoffice_preferences, rootKey);
34 @Override
35 public void onCreate(Bundle savedInstanceState) {
36 super.onCreate(savedInstanceState);
37 if(!BuildConfig.ALLOW_EDITING) {
38 PreferenceGroup generalGroup = findPreference("PREF_CATEGORY_GENERAL");
39 generalGroup.removePreference(generalGroup.findPreference("ENABLE_EXPERIMENTAL"));
40 generalGroup.removePreference(generalGroup.findPreference("ENABLE_DEVELOPER"));
45 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */