Working with Fragments in Monodroid
===

My (albeit still limited as I'm just beginning) understanding of Fragments is that they are somewhat similar to usercontrols in WPF - and since I intent to reuse certain GUI elements, putting them into activities seems to result in a lot of duplicate code.

So, based on fragment example in the documentation, I tried making my own.

    public class MyFragment: Fragment
    {

        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
        }

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (container == null)
            {
                Log.Debug("SmartApp", "Dialer Fragment is in a view without container");
                return null;
            }

            input = container.FindViewById<EditText>(Resource.Id.editText1);
    //do some stuff like assigning event handlers, etc.
          
            return base.OnCreateView(inflater, container, savedInstanceState);
        }
    }

And the activity that is supposed to host this fragment:

    [Activity(Label = "My Activity")]
    public class TestActivity: Activity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.my_layout);
        }
    }

and finally the layout definition for this activity

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <fragment class="MonoDevelopTest.MyFragment"
            android:id="@+id/titles_fragment"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" />
    </LinearLayout>

When I debug this, I get an InflateException in MyActivity.OnCreate (on the SetContentView line). So, I'm not doing things right - what would be the proper way to have my desired layout loaded for the activity and hosting my fragment in it?