I am trying to add some views programatically to a linear layout which is already defined in the xml file.
This is my code for defining the LinearLayout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
However, as you can see it does not have an id element. How can I add one so that I can call the method findViewById from my activity to retrieve the layout? I tried adding it manually but it is not generated in the R.java.
Thanks
Umm, like this?
If you add it and have an issue, try Project -> Clean.
If all else fails, find and nuke the R.java file in your gen -> package directory to force a rebuild of it.