hardcoded sting "x", should use @string resource



I got this error in my xml file in the layout folder. I changed it to android:text="@string/x" but then it shows this on the buttons: enter image description here


Here is my main_menu.xml:



<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:layout_width="150dp"
android:layout_height="match_parent"
android:layout_marginLeft="100dp"
android:orientation="vertical" >

<TextView
android:id="@+id/menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Menu" //warning here
android:textAppearance="?android:attr/textAppearanceLarge" />

<Button
android:id="@+id/one_player"
android:layout_width="115dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="1player" />//warning here

<Button
android:id="@+id/two_player"
android:layout_width="115dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="2players" />//warning here

<Button
android:id="@+id/exit_game"
android:layout_width="wrap_content"
android:layout_marginTop="20dp"
android:layout_height="115dp"
android:text="exitgame" />//warning here

</LinearLayout>

No comments:

Post a Comment