Consider there is an activity with a title. Viewpager fragment is inside the activity. Fragment will be loaded with data from network API.
Now I need to update the activity title after getting the data from API.
Problem:
- Since Viewpager is used, it loads the (prev), current, (next) fragments too. So activity is not aware of which title it is for.
- Each title is different for each fragment, so I need to update the title only when the user views that fragment.