Hi I am developing android application in which I am using I am using single Activity and 3 fragments. So consider I have 3 fragments A B C. When I switch from A to
Activity
Put this code in your fragment.
@Override public void setUserVisibleHint(boolean visible) { super.setUserVisibleHint(visible); if (visible && isResumed()) { onResume(); } } @Override public void onResume() { super.onResume(); if (!getUserVisibleHint()) { return; } setData(); }