片段我在我的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