0

I am using a view pager, where i am adding 3 fragments. I can redirect to Fragment A, or by swiping from Fragment B. How can i restrict the call of web services in Fragment A when i navigate to fragment B.

imi
  • 259
  • 1
  • 3
  • 14
  • I have used the set user visibility approach, but it doesn't seem to work fully. Each time i navigate to Fragment B, the on Create View of Fragment A is being called and get User visibility Hint method returns true. – imi Mar 08 '19 at 10:27
  • try [this](https://stackoverflow.com/a/12523627/5912570) using setMenuVisibility. – Harshad Prajapati Mar 08 '19 at 10:40
  • Possible duplicate of [how load fragment in ViewPager only when its selected](https://stackoverflow.com/questions/19485848/how-load-fragment-in-viewpager-only-when-its-selected) – ADM Mar 08 '19 at 10:42

0 Answers0