2013-04-29 85 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 =“”。