SettingsFragment.java 文件源码

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

项目:IO_Classic_WatchFace 作者:
/**
 * Gets the list of preferences in a PreferenceScreen
 *
 * @param p    preference to add to the list
 * @param list of preferences in the PreferenceScreen
 * @return a list of all the preferences
 */
private ArrayList<Preference> getPreferenceList(Preference p, ArrayList<Preference> list) {
    if (p instanceof PreferenceCategory || p instanceof PreferenceScreen) {
        PreferenceGroup prefGroup = (PreferenceGroup) p;

        final int prefCount = prefGroup.getPreferenceCount();

        for (int i = 0; i < prefCount; i++) {
            getPreferenceList(prefGroup.getPreference(i), list);
        }
    }

    if (!(p instanceof PreferenceCategory)) {
        list.add(p);
    }

    return list;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号