How to put variable inside string-resources?

后端 未结 4 405
情歌与酒
情歌与酒 2020-12-08 18:07

Is it possible to put variables inside string-resources? And if yes - how do i use them.

What i need is the following:

4条回答
  •  旧巷少年郎
    2020-12-08 18:37

    yes,you can use. after adding tag to string.xml file and then to retrrive the the same in your .java file you can follow this.

    AndriodApp

    String str = getResources().getString(R.string.name);

提交回复
热议问题