Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Like any other view object, a fragment can either be part of the XML definition of a layout, or be added to a view programmatically. In a layout, a fragment looks like this:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<fragment
class="com.oreilly.demo.android.ch085.contactviewer.DateTime"
android:id="@+id/date_time"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>