public void selectFrag(View view){
Fragment fr;
Button btn1 , btn2;
//버튼들
btn1 = (Button) findViewById(R.id.button1);
btn2 = (Button) findViewById(R.id.button2);
if(view == findViewById(R.id.button2)){
FragmentManager fm = getFragmentManager();
FragmentTransaction fragmentTransaction = fm.beginTransaction();
fragmentTransaction.replace(R.id.fragment_place, new StatusBarSecondActivity());
fragmentTransaction.commit();
btn1.setBackgroundResource(R.drawable.unusingpage);
btn2.setBackgroundResource(R.drawable.usingpage);
}else {
FragmentManager fm = getFragmentManager();
FragmentTransaction fragmentTransaction = fm.beginTransaction();
fragmentTransaction.replace(R.id.fragment_place, new StatusBarFirstActivity());
fragmentTransaction.commit();
btn2.setBackgroundResource(R.drawable.unusingpage);
btn1.setBackgroundResource(R.drawable.usingpage);
}
}
자바는 다음과 같이 구동이 되구요!!
<fragment
android:id="@+id/fragment_place"
android:name="com.example.dklee.candybar_ver00.StatusBarFirstActivity"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
tools:layout="@layout/candybar_mainpage" />
xml에 StatusBarFirstActivity라는 Activity가 다른 칸으로 넘어가면 지워지지를 않네요 ㅠㅠ
어떻게 해야되는건가요 ㅠㅠㅠ