Error inflating class-fragment aus der xml

Fand ich einige ähnliche Fragen hier, aber die vorgeschlagenen Antworten nicht zu mir passen.

Also der Fehler ist :

08-13 14:40:10.723: E/AndroidRuntime(630): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fragments/com.example.fragments.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment

Meiner MainActivity ist:

    package com.example.fragments;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

public class MainActivity extends FragmentActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

}

Meine xml ist :

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <fragment
        android:id="@+id/listFragment"
        android:layout_width="150dip"
        android:layout_height="match_parent"
        android:layout_marginTop="?android:attr/actionBarSize"
        class="com.example.fragments.ListFragment" >
    </fragment>

    <fragment
        android:id="@+id/detailFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.example.fragments.DetailFragment" >
    </fragment>

</LinearLayout>

Wäre sehr dankbar für jede Hilfe, die betrifft dieses Problem

xx

  • sind die Klassen com.Beispiel.Fragmente.ListFragment , com.Beispiel.Fragmente.DetailFragment präsentieren Sie in Ihrer app?
  • Liebe nandeesh, ja, Sie sind vorhanden in den Projekt-Ordner und sind im Paket com.Beispiel.Fragmente
InformationsquelleAutor Dennis | 2012-08-13
Schreibe einen Kommentar