Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
- <FrameLayout
- android:id="@+id/frame1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1" >
- </FrameLayout>
- <FrameLayout
- android:id="@+id/frame2"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="3" >
- </FrameLayout>
- </LinearLayout>
- NewFragment fragment = new NewFragment();
- FragmentManager fm = getFragmentManager();
- FragmentTransaction ft = fm.beginTransaction();
- ft.add(R.id.frame1, fragment);
- ft.commit();
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <fragment android:name="com.example.android.fragments.HeadlinesFragment"
- android:id="@+id/headlines_fragment"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="match_parent" />
- <fragment android:name="com.example.android.fragments.ArticleFragment"
- android:id="@+id/article_fragment"
- android:layout_weight="3"
- android:layout_width="0dp"
- android:layout_height="match_parent" />
- </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement