CameraSettingsActivity.java 文件源码

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

项目:Camera2 作者:
/**
 * Recursively traverses the tree from the given group as the route and
 * tries to delete the preference. Traversal stops once the preference
 * was found and removed.
 */
private boolean recursiveDelete(PreferenceGroup group, Preference preference) {
    if (group == null) {
        Log.d(TAG, "attempting to delete from null preference group");
        return false;
    }
    if (preference == null) {
        Log.d(TAG, "attempting to delete null preference");
        return false;
    }
    if (group.removePreference(preference)) {
        // Removal was successful.
        return true;
    }

    for (int i = 0; i < group.getPreferenceCount(); ++i) {
        Preference pref = group.getPreference(i);
        if (pref instanceof PreferenceGroup) {
            if (recursiveDelete((PreferenceGroup) pref, preference)) {
                return true;
            }
        }
    }
    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号