I\'m defining an ID for my fragment in the xml layout:
R.id.test_fragment is your LinearLayout ID not your Fragment.
R.id.test_fragment
LinearLayout
You can define and id on a fragment when it is inflated from an xml like in this sample http://developer.android.com/guide/topics/fundamentals/fragments.html#Adding