今天用了一下fragment,造成了路径找不到的问题,把这个问题记录下来,给遇到相同问题的朋友做个参考:
我在main.xml中加入了两个fragment 代码如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:baselineAligned="false"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="@+id/fragment1"
android:name="com.example.fragmentDemo.Fragment1"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_width="0dip"
/>
<fragment
android:id="@+id/fragment2"
android:name="com.example.fragmentDemo.Fragment2"
android:layout_weight="1"
android:l