How to use string created string.xml via code

0

How to use string created strings.xml via code example you have to call <string name="hello_world">Hello world!</string> at some point in the code ( Activity ).

    
asked by anonymous 08.04.2015 / 20:51

2 answers

1

I recommend reading this topic:

link

But to refer to a String located in resources / values, it is:

String string = getString(R.string.hello);
    
08.04.2015 / 20:55
0
String mensagem = getResources().getString(R.string.hello_world);

link

    
08.04.2015 / 20:57