Android strings.xml 长度 [英] Android strings.xml length

查看:59
本文介绍了Android strings.xml 长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法获取我的 strings.xml 中的字符串数量或检查所有字符串是否在所选语言中可用?

Is there a way to get the number of strings in my strings.xml or to check if all strings are available in the selected language?

推荐答案

我不认为公共 api 中有什么东西.您可以尝试使用反射,因为从 strings.xml 生成了 R.string 类..

I don't think there is something in the public api. You can try with reflection since from strings.xml the R.string class is generated..

试试这个:

Field[] f = R.string.class.getDeclaredFields();

这篇关于Android strings.xml 长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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