初学Android
编写layout布局文件,出现错误Hardcoded string should use @string resource
<Button
android:id="@+id/Button_1"
android:layout_width="match_parent"
android:layout_heigt="wrap_content"
android:text="Have a nice day!" />
提示:Extract string resource
解决:
或者在手动在strings.xml添加,并在原xml修改
<resources>
<string name="app_name">1</string>
<string name="have_a_nice_day">Have a nice day!</string>
</resources>
android:text="@string/have_a_nice_day"
问题解决