0

I have created new string in strings.xml and saved it. When i am trying to use it in my layout.xml i get this error:

no resource found that matches the given name (at'text' with value '@string/breadth')

the xml code where i am trying to use the strin is:

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="#2F4F4F"
    android:text="@string/breadth"
    android:textAppearance="?android:attr/textAppearanceMedium" />

the string created is:

    <string name="breadth ">Breadth in cms</string>

please help

3
  • 1
    You have a space after "breadth" in your <string name="breadth ">Breadth in cms</string> Commented Feb 6, 2013 at 12:14
  • such an easy mistake. thank You it works. Commented Feb 6, 2013 at 12:21
  • No problem. Happens to the best of us. ;-) Commented Feb 6, 2013 at 12:22

2 Answers 2

1

You have a typo. Instead of:

<string name="breadth ">Breadth in cms</string>

use:

<string name="breadth">Breadth in cms</string>

Note the removed space ().

Sign up to request clarification or add additional context in comments.

Comments

0

Remove the space from your string name="breadth " in your string.xml file as below:

<string name="breadth">Breadth in cms</string>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.