Load dimension value from res/values/dimension.xml from source code

前端 未结 9 1748
情书的邮戳
情书的邮戳 2020-11-27 09:30

I\'d like to load the value as it is. I have two dimension.xml files, one in /res/values/dimension.xml and the other one in /res/values-sw360

9条回答
  •  抹茶落季
    2020-11-27 10:05

    For those who just need to save some int value in the resources, you can do the following.

    integers.xml

    
    
        100
     
    

    Code

    int defaultValue = getResources().getInteger(R.integer.default_value);
    

提交回复
热议问题