-3
조각에서 작업 중입니다. 그것은 2 개 버튼과 FrameLayout이 포함되어 있습니다조각 내 프레임 레이아웃
나는 버튼 클릭에 FrameLayout이 다른 조각을로드 할 주 FrameLayout이 교체하지 않으<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="fragments.Fragment_Book_A_Cam">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<Button
android:id="@+id/bt_Public"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_weight="1"
android:background="@drawable/red"
android:text="Public Jobs "
android:textColor="#FFFFFF" />
<Button
android:id="@+id/bt_Active"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_weight="1"
android:background="@drawable/black"
android:text="Active Jobs"
android:textColor="#FFFFFF" />
</LinearLayout>
<FrameLayout
android:id="@+id/Fragment_Jobs_BookACam"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
.
모든 방법 나는 크래시를 사용하거나 메인 프래그먼트를 교체했습니다.
bt_Public.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// fragment = new Fragment_MyCloudVideo();
// FragmentManager fragmentManager = ;
// FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
// fragmentTransaction.replace(R.id.Fragment_MyVideos, fragment);
// fragmentTransaction.commit();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
Fragment_Public_Jobs fragment = new Fragment_Public_Jobs();
fragmentTransaction.addToBackStack("xyz");
fragmentTransaction.hide(Fragment_Book_A_Cam.this);
fragmentTransaction.add(android.R.id.content, fragment);
fragmentTransaction.commit();
}
});