When using SugarTask in fragments which are accessed with ViewPager, it makes an IllegalStateException
: Fragment has not been attached yet.
This happens when you select a fragment and the next fragment in viewpager is being initialized but not visible because viewpager offscreen limit was set to 1.
So, how to avoid this?