O'Reilly logo
  • Hoang Dung Nguyen thinks this is interesting:

Notice that you check to see whether getActivity() is null before setting the adapter. Remember that fragments can exist unattached from any activity


Cover of Android Programming: The Big Nerd Ranch Guide


Check if a fragment is still attached