Fragment_run.xml needs a correction


#1

The fragment_run.xml file, downloaded from the website, is missing android:id="@+id/fragmentContainer". Without this you will receive a “fragmentContainer cannot be resolved or is not a field” error on SingleFragmentActivity.java


#2

The code from the web site works a little differently from the code described in the book. Instead, R.id.fragmentContainer is defined in res/values/id.xml, and then assigned dynamically inside SingleFragmentActivity.java. With that defined, it is not necessary to define fragmentContainer inside fragment_run.xml.


#3

Yes I found this one myself - could not understand why SingleFragmentActivity in your code was changed from the one we had been using in the book…


#4

Should not it be ids.xml? I thought in an earlier chapter it was so, and Eclipse did not build until I refactored id.xml to ids.xml.