Milo StaKic Milo StaKic - 2 years ago 110
Android Question

String Not Being Modified By strings.xml

I'm using android sdk and am trying to change the name of a string. I've started a new project, the activity_main.xml shows Hello World! on the screen.

I go into strings.xml file and there was nothing even referencing this string so I added in

<string name="hello_world">Hello World!</string>

I tried modifying
Hello World!
and changed it to something like this:

<string name="hello_world">Helloooo Worldsss!</string>

yet nothing changed.

So I looked further into the textview of the activity_main.xml

and modified the

android:[email protected]/hello_world

now the text Hello World! has disappeared from the screen entirely. Perhaps it needs to be referenced to enter the strings.xml file from the textview of activity_main.xml?

I'm brand new to Java.

Answer Source

This looks like simply a case of syntax; you need quote marks.

So android:text="@string/hello_world"

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download