代码中获取String.xml中的字符串?

问题:

代码中获取String.xml中的字符串?

解决办法:

1.在activity里:

方法一:this.getString(R.string.resource_name);

方法二:getResources().getString(R.string.resource_name);

2.在其他java文件(必须有Context或aplication)

方法一:context.getString(R.string.resource_name);

方法二:application.getString(R.string.resource_name);

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念