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
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+sjust saves the file you’re in, so compilation will occur without the changes in the other file.Pressing
ctrl-shift-ssaves changes in all open files (same as going toFile -> Save All).Personally, I hit
ctrl-shift-o,ctrl-shift-fandctrl-shift-severytime I need to save some changes to organize the imports, format the code to fix indenting etc. and to save all changes.