메인프래그먼트입니다.
public class MainFragment extends Fragment {
ImageView Image1;
ImageView Image2;
View rootView;
private OnFragmentInteractionListener mListener;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_main, container, false);
pref = getActivity().getSharedPreferences(getResources().getString(R.string.app_name), MODE_PRIVATE);
Image1 = (ImageView)rootView.findViewById(R.id.image1);
Image2 = (ImageView)rootView.findViewById(R.id.image2);
// Inflate the layout for this fragment
return rootView;
}
제어할 명령어 프래그먼트
public class SetFragment extends Fragment {
View rootView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
rootView = (LinearLayout)inflater.inflate(R.layout.fragment_set, container, false);
CheckBox white = (CheckBox) rootView.findViewById(R.id.whitebox);
CheckBox redbox = (CheckBox)rootView.findViewById(R.id.redbox);
return rootView;
}
}
명령프래그먼트에서 체크박스를 통해 이미지를 제어하려고하는데,
값이 안전달되네요.. 어떻게 전달해야 이미지를 보여졌다 안보여졌다 할수있나요?