Best way to handle NullPointerException after Network Calls?
<p>Most of the time, the network calls would finish AFTER the Fragment is detached, that's why the getActivity() returns null. What's your typical solution to this?</p>

<p>Solution #1: When the fragment goes paused, kill all the network calls.</p>

<p>Solution #2: Add a "isDetached()" checking</p>

<p>Solution #3: Add a "isAdded()" checking</p>

<p>Solution #4: Have a reference of the activity, mActivity</p>