onHiddenChanged - Activity里有多个fragment时,请求数据的优化
问题:当Activity里有多个fragment时,其中fragmentA根据需求,需要在onResume时需要做请求数据等操作,但是如果直接在fragmentA里的onResume里写东西,当从其他页面返回到fragmentB和fragmentC时,fragmentA里的onResume也会走,这样很浪费流量浪费资源。问题原因:fragment的生命周期是跟着它所在的activity