片段我在我的XML布局定义的片段,我想从我的fragmentactivity传递数据给它。那可能吗 ?我不想在运行时包含片段,因为我不打算在活动期间更改片段。 这里是我的xml将数据传递给静态包含从片段活动
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<fragment
android:id="@+id/profileFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
class="com.fragments.MyProfileFragment" >
</fragment>
<fragment
android:id="@+id/hoppiesFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
class="com.fragments.HoppiesFragment" >
</fragment>
</LinearLayout>
能否请您接受的答案吗? – 2014-12-04 11:57:24
我接受了你的回答。谢谢:) – 2014-12-04 12:05:17