如何通过代码更新res / values / array.xml中的数组? [英] How to update arrays in res/values/array.xml by code?

查看:55
本文介绍了如何通过代码更新res / values / array.xml中的数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用

资源res = this.getResources();

arr1 = res.getStringArray(R .array.one);

获取数组并更改其某些值,

to get the array and changed some of its values,

然后如何将新值保存回 res / values / array.xml 文件?

Then how can I save the new values back to the file of res/values/array.xml?

推荐答案

您不能保存新值。资源在运行时是只读的。

You cannot "save the new values". Resources are read-only at runtime.

这篇关于如何通过代码更新res / values / array.xml中的数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆