I am new to Android development. I recently downloaded the latest Android Studio 3.0.1. I am using Wallace Jackson "Android Apps for Absolute Beginners". I have 2 XML files when I created my (first) application per the book:
- activity_main.xml
- strings.xml
activity_main.xml file has hard coded the android:txt="Hello World!"
The book guides you to modify file 1 to refer to strings.xml for this string.
File 2, strings.xml, is modified to add a 2nd line containing the string that is modified slightly by removing the "!".
When I look at the preview layout pane in the Android SDK I don't see the string "Hello World"
Instead, I see "@string".
I am sure I doing something basically wrong, or missing a crucial step, or steps.
This is the activity_main.xml file (file 1)
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.michael.myapplication.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
This is strings.xml file (file 2):
<resources>
<string name="app_name">My Application</string>
<string name="app_message">Hello WORLD</string>
</resources>