Can't Resolve Android Resource Strings

android, string

Solution

Whenever you add something to a resource file and try to use it in another without saving it first, you will get an error.

The normal `ctrl+s` just saves the file you're in, so compilation will occur without the changes in the other file.

Pressing `ctrl-shift-s` saves changes in all open files (same as going to `File -> Save All`).

Personally, I hit `ctrl-shift-o`, `ctrl-shift-f` and `ctrl-shift-s` everytime I need to save some changes to organize the imports, format the code to fix indenting etc. and to save all changes.

Problem

I am learning Android, and I have what I think is a weird problem. in /res/values/strings.xml I have: ``` <string name="titleStatus">Status Update</string> ``` in /res/layout/activity_status.xml I have: ``` <!-- Title TextView--> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:textSize="30sp" android:layout_margin="10dp" android:text="@string/titleStatus"/> ``` However, when viewing activity_status.xml I am getting error: Error: No resource found that matches the given name (at 'text' with value '@string/titleStatus'). activity_status.xml I then figured it could possibly help use "Project | Clean", but I get the same problem (and now without the auto-generated R.java class) I am following this tutorial/book: http://ofps.oreilly.com/titles/9781449390501/Android_User_Interface.html

Original source