in my application i want to do the following things : i want to put a list view in a fragment and when i click on any item it should move me to other fragment this fragment is the same because i want to read the feeds for each item and show it in other fragment which called the detail fragment ,, i saw this example on the internet and i do it step by step but at the run time i have an exception ,, please tell me why this exception occurs i have 4 classes ,, and about the xml files i have 2 the first with name layout-land with this code :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent" android:layout_height="match_parent">
<fragment class="com.example.android.apis.app.FragmentLayout$TitlesFragment"
android:id="@+id/titles" android:layout_weight="1"
android:layout_width="0px" android:layout_height="match_parent" />
<FrameLayout android:id="@+id/details" android:layout_weight="1"
android:layout_width="0px" android:layout_height="match_parent"
/>
</LinearLayout>
Using this layout, the system instantiates the TitlesFragment (which lists the play titles) as soon as the activity loads the layout, while the FrameLayout (where the fragment for showing the play summary will go) consumes space on the right side of the screen, but remains empty at first. As you'll see below, it's not until the user selects an item from the list that a fragment is placed into the FrameLayout.
However, not all screen configurations are wide enough to show both the list of plays and the summary, side by side. So, the layout above is used only for the landscape screen configuration, by saving it at res/layout-land/fragment_layout.xml.
Thus, when the screen is in portrait orientation, the system applies the following layout, which is saved at res/layout/fragment_layout.xml:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android1="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment class="com.example.android.apis.app.FragmentLayout$TitlesFragment"
android:id="@+id/titles"
android:layout_width="match_parent" android:layout_height="match_parent" />
<ListView
android1:id="@+id/listView1"
android1:layout_width="match_parent"
android1:layout_height="wrap_content" >
</ListView>
and i have this run time exception :
08-04 11:59:52.127: E/AndroidRuntime(1124): FATAL EXCEPTION: main
08-04 11:59:52.127: E/AndroidRuntime(1124): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.list_fragment/com.example.list_fragment.MainActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
08-04 11:59:52.127: E/AndroidRuntime(1124): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
08-04 11:59:52.127: E/AndroidRuntime(1124): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
08-04 11:59:52.127: E/AndroidRuntime(1124): at android.app.ActivityThread.access$600(ActivityThread.java:141)
08-04 11:59:52.127: E/AndroidRuntime(1124): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
08-04 11:59:52.127: E/AndroidRuntime(1124): at android.os.Handler.dispatchMessage(Handler.java:99)
08-04 11:59:52.127: E/AndroidRuntime(1124): at android.os.Looper.loop(Looper.java:137)
08-04 11:59:52.127: E/AndroidRuntime(1124): at android.app.ActivityThread.main(ActivityThread.java:5039)
08-04 11:59:52.127: E/AndroidRuntime(1124): at java.lang.reflect.Method.invokeNative(Native Method)
08-04 11:59:52.127: E/AndroidRuntime(1124): at java.lang.reflect.Method.invoke(Method.java:511)
08-04 11:59:52.127: E/AndroidRuntime(1124): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)