Witajcie,
zastanawiam się jak można wywołać typ boolean w objekcie. Robię to w ten sposób ale oczywiście błędnie
`maps.setImageResource(mapImage);`
public class Fragment1 extends Fragment implements viewPagerFragmentInterface {
String stringValue;
int imagesResId;
TextView text;
String[] rbData;
RadioGroup radioButtons;
boolean mapImage;
View answer;
public Fragment1(String str, int imageView, String[] rb, boolean map ) {
this.stringValue = str;
this.imagesResId = imageView;
this.rbData = rb;
this.mapImage = map;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Log.i("x","onCreateViewFragment");
View view = inflater.inflate(R.layout.fragment_1, container, false);
text = view.findViewById(R.id.textView);
ImageView imageResId = view.findViewById(image);
answer = view.findViewById((R.id.radioGroup));
ImageView maps = view.findViewById(map_images);
if(mapImage){
view = inflater.inflate(R.layout.maps, container, false);
maps. //CHODZI O USTAWIENIE TUTAJ OBJEKTU maps
}else{
view = inflater.inflate(R.layout.fragment_1, container, false);
text = view.findViewById(R.id.textView);
radioButtons = view.findViewById(R.id.radioGroup);
text.setText(stringValue);
imageResId.setImageResource(imagesResId);
}