AbbyPaden
AbbyPaden

Reputation: 602

android:text issues with @string

I purchased a Beginning Android book and started reading and performing the examples. The very first one says to add code like this:

...
...
android:text="This is my first Android Application!" />

My question is, are we no longer using the "@string/..."? I get a warning that I should use it, but when I do it turns into a red X. With the warning, it at leasts tries to run but the emulator crashes. Any ideas?

Thanks!

Steve

Upvotes: 0

Views: 234

Answers (1)

AJak
AJak

Reputation: 3873

You probably want to be using something along the lines of

android:text="@string/copy_here"

Then in the strings file use

<string name="copy_here">copy here</string>

Upvotes: 3

Related Questions