Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to use string defined in string.xml

shaywshayw Member ✭✭

Hi
in string xml i added Number
in mainactivity.cs i have a textview
<TextView
android:layout_width="match_parent"
android:text="@string/Number"

indicates an error this resource url can not be resolved
What wrong with the string Number ?

Thanks

Tagged:

Best Answer

  • shaywshayw Member ✭✭
    Accepted Answer

    I found my mistake instead using the name string, i used its content.
    now it works
    List of all years

    android:text="@string/titleyears"

Answers

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    I use this

        android:text="@string/leggere_barcode_camion"
    

    and it works

  • shaywshayw Member ✭✭
    Accepted Answer

    I found my mistake instead using the name string, i used its content.
    now it works
    List of all years

    android:text="@string/titleyears"

  • ColeXColeX Member, Xamarin Team Xamurai
    edited October 20

    @shayw said:
    I found my mistake instead using the name string, i used its content.
    now it works
    List of all years

    android:text="@string/titleyears"

    Could you mark the answer If the problem gets resolved ?

Sign In or Register to comment.