Made as an example, before tabs, tabs are not needed:
https://habrahabr.ru/post/236567/
But there they did not suggest for beginners how to turn now to the elements in the fragment. I read the examples, tried it, but something goes wrong. Maybe the problem is that the examples for android above v4.
How now to address to elements which in a screen_one fragment? How, for example, process the NumberPicker and set the minimum and maximum values and handle the OnValueChangeListener event from the mainActivity?
I understand that for beginners, but I can not understand. I read examples of the appeal from the main activity to the fragment, but it cannot be applied to this particular case ...
How to contact from the fragment itself, I figured out:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.screen_one, container, false); // numberPicker.findViewById(R.id.light_on_hour); NumberPicker light_on_hours = (NumberPicker) rootView.findViewById(R.id.light_on_hour); light_on_hours.setEnabled(true); light_on_hours.setMinValue(0); light_on_hours.setMaxValue(23); light_on_hours.setValue(10); return rootView; } Tell me how to contact the activity and listeners in the activity to intercept or transfer to the activity. And how to change the values of the activity.