change String.xml by java class

0

Hello, I was wondering if it is possible to modify a String from the values folder by a click of a button.

these are String.xml

<string name="app_name">FC MANAGER</string>
<string name="goleiro_1">1 Diego Alves</string>
<string name="goleiro_2">37 César</string>
<string name="zagueiro_1">15 Rever</string>
<string name="zagueiro_2">4 Juan</string>
<string name="zagueiro_3">44 Rhodolfo</string>
<string name="zagueiro_4">43 Léo Duarte</string>
<string name="lateraldireito_1">2 Rodinei</string>
<string name="lateraldireito_2">21 Pará</string>
<string name="lateralesquerdo_1">6 Renê</string>
<string name="lateralesquerdo_2">13 Miguel Trauco</string>
<string name="volante_1">8 Cuéllar</string>
<string name="volante_2">14 Jonas</string>
<string name="volante_3">27 Romulo</string>
<string name="meiocampo_1">10 Diego</string>
<string name="meiocampo_2">7 Everton Ribeiro</string>
<string name="meiocampo_3">11 Lucas Paquetá</string>
<string name="meiocampo_4">18 Jean Lucas</string>
<string name="atacante_1">19 Henrique Dourado</string>
<string name="atacante_2">20 Vinicius Junior</string>
<string name="atacante_3">29 Lincoln</string>
<string name="atacante_4">23 Geuvânio</string>
<string name="tecnico">Barbieri</string>

I wanted to know if it is possible through a command in the java class to change a string that is selected.

    
asked by anonymous 03.06.2018 / 02:30

1 answer

3

When you provide a value as a resource ( Resource ) it can not be modified at run time. For example, the images you have in your drawable folder can not be modified at run time and this applies to Strings.xml and the Values .

If you want a string to be modified at runtime, do not create it as a resource.

    
03.06.2018 / 03:20