Example usage for android.preference PreferenceCategory addItemFromInflater

List of usage examples for android.preference PreferenceCategory addItemFromInflater

Introduction

In this page you can find the example usage for android.preference PreferenceCategory addItemFromInflater.

Prototype

public void addItemFromInflater(Preference preference) 

Source Link

Document

Called by the inflater to add an item to this group.

Usage

From source file:de.azapps.mirakel.settings.custom_views.Settings.java

public static PreferenceScreen inflateHeaders(final @NonNull PreferenceScreen screen,
        final @NonNull OnItemClickedListener<Settings> onClick) {
    for (final Map.Entry<Integer, List<Settings>> id : all.entrySet()) {
        final PreferenceCategory cat = new PreferenceCategory(ctx);
        screen.addPreference(cat);/*www.  j a  v a 2s.c  om*/
        cat.setTitle(id.getKey());
        for (final Settings setting : id.getValue()) {
            if (setting == DEV && !MirakelCommonPreferences.isEnabledDebugMenu()) {
                continue;
            }
            cat.addItemFromInflater(setting.getPreference(onClick));
        }
    }
    return screen;

}