2013-04-29 95 views
3

我想在我code..After我點擊的片段用片段,並試圖使屏幕方向我得到了一個錯誤,如下面,充氣異常......安卓:在類片段

Unable to start activity ComponentInfo{com.example.frag/com.example.frag.Activity}: android.view.InflateException: Binary XML file line #11: Error inflating class fragment 

我的Xml

<LinearLayout android:id="@+id/linear" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" > 
<ListView android:id="@+id/android:list" android:layout_height="wrap_content" android:layout_width="fill_parent"/> 
<fragment android:id="@+id/frag" android:layout_height="fill_parent" android:layout_width="fill_parent" class="com.example.frag.MyFragment"/> 

回答

1

通過你給的信息有限,它看起來像你有在this後同樣的問題解決。

+0

是的,我會看到thanx – GaneshKumar 2013-04-29 04:56:17

0

試試這個:

<fragment 
    android:id="@+id/frag" 
    android:name="com.example.frag.MyFragment" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:layout="@layout/frag_layout" /> 

你必須使用Android:NAME = 「完全合格的路徑」。你已經使用class =「」。