Java Code Examples for android.preference.PreferenceFragment

The following are top voted examples for showing how to use android.preference.PreferenceFragment. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: GravityBox   File: MtkFixDevOptions.java   View source code 6 votes vote down vote up
public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) {
    try {
        final Class<?> classDevSettings = XposedHelpers.findClass(CLASS_DEV_SETTINGS, classLoader);

        if (DEBUG) log("hooking DeveloperSettings.onCreate method");
        XposedHelpers.findAndHookMethod(classDevSettings, "onCreate", Bundle.class, new XC_MethodHook() {
            @Override
            protected void beforeHookedMethod(final MethodHookParam param) throws Throwable {
                PreferenceFragment pf = (PreferenceFragment) param.thisObject;
                mResId = pf.getResources().getIdentifier("development_prefs", "xml", PACKAGE_NAME);
                if (DEBUG) log("mResId=" + mResId);
            }
        });
    }
    catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
Example 2
Project: Stringlate   File: SettingsActivity.java   View source code 6 votes vote down vote up
protected void showFragment(String tag, boolean addToBackStack) {
    PreferenceFragment fragment = (PreferenceFragment) getFragmentManager().findFragmentByTag(tag);
    if (fragment == null) {
        switch (tag) {
            case SettingsFragmentMaster.TAG:
            default:
                fragment = new SettingsFragmentMaster();
                toolbar.setTitle(R.string.settings);
                break;
        }
    }
    FragmentTransaction t = getFragmentManager().beginTransaction();
    if (addToBackStack) {
        t.addToBackStack(tag);
    }
    t.replace(R.id.settings__fragment_container, fragment, tag).commit();
}
 
Example 3
Project: open-wheels   File: Preferences.java   View source code 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    PreferenceFragment fragment = new MyPreferenceFragment();
    getFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit();
    getFragmentManager().executePendingTransactions();
    fragment.getPreferenceScreen().findPreference("a").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
        @Override
        public boolean onPreferenceClick(Preference preference) {
            Intent intent = new Intent(Preferences.this, IconPicker.class);
            startActivityForResult(intent, REQUEST_CODE);
            return true;
        }
    });

}
 
Example 4
Project: divertsy-client   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || LocationPreferenceFragment.class.getName().equals(fragmentName)
            || SyncPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 5
Project: Forge   File: Preferences.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || PasswordPreferenceFragment.class.getName().equals(fragmentName)
            || DateOfBirthPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 6
Project: shrinker   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 7
Project: SampleAppArch   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
  return PreferenceFragment.class.getName().equals(fragmentName)
      || GeneralPreferenceFragment.class.getName().equals(fragmentName)
      || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
      || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 8
Project: TimeTrix   File: SettingsPreferenceActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName ().equals (fragmentName)
            || GeneralPreferenceFragment.class.getName ().equals (fragmentName)
            || DataSyncPreferenceFragment.class.getName ().equals (fragmentName)
            || NotificationPreferenceFragment.class.getName ().equals (fragmentName);
}
 
Example 9
Project: cda-app   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName)
            || NamePreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 10
Project: DoorPhone   File: SettingsActivity.java   View source code 5 votes vote down vote up
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || SipPreferenceFragment.class.getName().equals(fragmentName)
            || VideoPreferenceFragment.class.getName().equals(fragmentName)
            || AudioPreferenceFragment.class.getName().equals(fragmentName)
            || CommandsPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationsPreferenceFragment.class.getName().equals(fragmentName)
            || AdvancedPreferenceFragment.class.getName().equals(fragmentName)
            || EchoCancellationPreferenceFragment.class.getName().equals(fragmentName)
            || SipAccountPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 11
Project: BeaconMqtt   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || MqttPreferenceFragment.class.getName().equals(fragmentName)
            || BeaconPreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 12
Project: AR   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 13
Project: C500Companion   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || BacklightPreferenceFragment.class.getName().equals(fragmentName)
            || BluetoothPreferenceFragment.class.getName().equals(fragmentName)
            || DebugPreferenceFragment.class.getName().equals(fragmentName)
            || AboutFragment.class.getName().equals(fragmentName);
}
 
Example 14
Project: LucaHome-AndroidApplication   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(@NonNull String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || UserPreferenceFragment.class.getName().equals(fragmentName)
            || NetworkPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName)
            || ReloadPreferenceFragment.class.getName().equals(fragmentName)
            || OpenWeatherPreferenceFragment.class.getName().equals(fragmentName)
            || WirelessSocketPreferenceFragment.class.getName().equals(fragmentName)
            || CoinPreferenceFragment.class.getName().equals(fragmentName)
            || WirelessSwitchPreferenceFragment.class.getName().equals(fragmentName)
            || PositionPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 15
Project: DeveloperSettings   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 16
Project: StudyBuddy   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || ExperimentalPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName)
            || VersionPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 17
Project: FastReading   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            //|| DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 18
Project: Auto.js   File: SettingsActivity.java   View source code 5 votes vote down vote up
private void setupViews() {
    setContentView(R.layout.activity_settings);
    getFragmentManager().beginTransaction().replace(R.id.fragment_setting, new PreferenceFragment()).commit();
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitle(R.string.text_settings);
    toolbar.setNavigationOnClickListener(v -> finish());
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 
Example 19
Project: Cybernet-VPN   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 20
Project: chromium-for-android-56-debug-video   File: Preferences.java   View source code 5 votes vote down vote up
@Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Fragment fragment = getFragmentManager().findFragmentById(android.R.id.content);
        if (fragment instanceof PreferenceFragment && fragment.getView() != null) {
            // Set list view padding to 0 so dividers are the full width of the screen.
            fragment.getView().findViewById(android.R.id.list).setPadding(0, 0, 0, 0);
        }
    }
}
 
Example 21
Project: OpenPad-for-Android   File: SettingsActivity.java   View source code 5 votes vote down vote up
@Override
protected boolean isValidFragment(String _fragmentName) {
    return PreferenceFragment.class.getName().equals(_fragmentName)
            || FontSettings.class.getName().equals(_fragmentName)
            || Settings.class.getName().equals(_fragmentName)
            || Help.class.getName().equals(_fragmentName);
}
 
Example 22
Project: notify-me   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 23
Project: anitrend-app   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 24
Project: QuotesOnDesign   File: ActivityPreferences.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
@Override
protected boolean isValidFragment( String fragmentName )
{
  return PreferenceFragment.class.getName().equals( fragmentName )
         || PreferenceFragmentGeneral.class.getName().equals( fragmentName );
}
 
Example 25
Project: SSLSocks   File: AdvancedSettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
	return PreferenceFragment.class.getName().equals(fragmentName)
			|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
			|| DataSyncPreferenceFragment.class.getName().equals(fragmentName)
			|| NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 26
Project: can4eve   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
  return PreferenceFragment.class.getName().equals(fragmentName)
    || GeneralPreferenceFragment.class.getName().equals(fragmentName)
    || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
    || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 27
Project: freeu2f-android   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 28
Project: GravityBox   File: MtkFixTtsSettings.java   View source code 5 votes vote down vote up
public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) {
    try {
        final Class<?> classVoiceIoSettings = XposedHelpers.findClass(CLASS_VOICEIO_SETTINGS, classLoader);

        if (DEBUG) log("replacing populateOrRemovePreferences method");
        XposedHelpers.findAndHookMethod(classVoiceIoSettings, "populateOrRemovePreferences", 
                new XC_MethodReplacement() {

                    @Override
                    protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
                        boolean hasRecognizer = (Boolean) XposedHelpers.callMethod(param.thisObject, 
                                        "populateOrRemoveRecognizerPrefs");
                        boolean hasTts = (Boolean) XposedHelpers.callMethod(param.thisObject,
                                        "populateOrRemoveTtsPrefs");
                        if (DEBUG) log("populateOrRemovePreferences: hasRecognizer=" + hasRecognizer + "; hasTts=" + hasTts);

                        if (hasRecognizer || hasTts) {
                            return null;
                        }

                        PreferenceFragment fragment = (PreferenceFragment) XposedHelpers.getObjectField(
                                param.thisObject, "mFragment");
                        PreferenceCategory prefCat = (PreferenceCategory) XposedHelpers.getObjectField(
                                param.thisObject, "mVoiceCategory");
                        if (fragment != null && prefCat != null) {
                            fragment.getPreferenceScreen().removePreference(prefCat);
                        }

                        return null;
                    }
            
        });
    }
    catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
Example 29
Project: daily-menu-android   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 30
Project: AndroidBlueprints   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || ApplicationBehaviourPreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 31
Project: BrewBook   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 32
Project: AndiCar   File: PreferenceActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || FinancialPreferenceFragment.class.getName().equals(fragmentName)
            || BackupRestorePreferenceFragment.class.getName().equals(fragmentName)
            || GPSTrackPreferenceFragment.class.getName().equals(fragmentName)
            || MainScreenPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 33
Project: Simple-Search   File: Settings.java   View source code 5 votes vote down vote up
/**
 * Tests if a loaded fragment is valid
 *
 * @param fragmentName The name of the fragment to test
 * @return True if it's valid, false otherwise
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || SearchPreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName);

}
 
Example 34
Project: SERC-ENERYGY-METERING-MOBILE-APP   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || GraphPreferenceFragment.class.getName().equals(fragmentName)
            || AccountPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 35
Project: pineapple   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 36
Project: TrumpBot   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 37
Project: privacy-friendly-pedometer   File: PreferencesActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
            //|| HelpFragment.class.getName().equals(fragmentName);
}
 
Example 38
Project: intra42   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName)
            || NetworkPreferenceFragment.class.getName().equals(fragmentName)
            || AdvancedPreferenceFragment.class.getName().equals(fragmentName)
            || ThemePreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 39
Project: BlogReader   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
 
Example 40
Project: ebookmgr   File: SettingsActivity.java   View source code 5 votes vote down vote up
/**
 * This method stops fragment injection in malicious applications.
 * Make sure to deny any unknown fragments here.
 */
protected boolean isValidFragment(String fragmentName) {
    return PreferenceFragment.class.getName().equals(fragmentName)
            || GeneralPreferenceFragment.class.getName().equals(fragmentName)
            || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
            || NotificationPreferenceFragment.class.getName().equals(fragmentName);
}