I have implemented in my application tab swiping with ViewPager, Fragments etc. Everything is working fine. But I would like to know which function is run after swiping to next tab? Because I need to refresh some data when user will swipe to next screen.
I have this functions in my activity:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
rootview = inflater.inflate(R.layout.activity_main_sensors_p, container, false);
return rootview;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
update_data();
display_items();
}