I got a ViewPager inside my activity. One of fragments inside ViewPager, call it FragmentA, have a GridView inside it.
In some cases, some message from network are received to my application and I have to update FragmentA.GridView and refresh it using its adapter. Since network events are not synchronous with application, I need to have an instance of FragmentA in case of receiving of new messages and refresh its content.
I want to know which events are suitable for this event? My most important case for this action is when I'm in the same activity but on other pages of ViewPager.I used below events, please fix me if I'm wrong.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Utils.fragmentStaticInstance = this;
}
@Override
public void onStop() {
super.onStop();
Utils.fragmentStaticInstance=null;
}
