Nested preferences.xml

后端 未结 4 1476
小蘑菇
小蘑菇 2020-12-24 06:03

Is it somehow possible to include one preferences.xml into another, like it can be done for layouts with the tag?

Let\'s

4条回答
  •  甜味超标
    2020-12-24 06:28

    The solution soul shows works. It can be expanded to only show preferences if you're the developer using an unsigned version of the app ;)

    addPreferencesFromResource(R.xml.options);
    addPreferencesFromResource(R.xml.additional_options);
    if (BuildConfig.DEBUG) {
        addPreferencesFromResource(R.xml.developer_options);
    }
    

    I created a blog post regarding this issue and have a complete working code example available for download. http://androidfu.blogspot.com/2012/05/developer-debug-with-nested-preferences.html

提交回复
热议问题