@Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup view = (ViewGroup) inflater.inflate(layout, container, false);

    listView = (ListView) view.findViewById(R.id.com_facebook_picker_list_view);
    listView.setOnItemClickListener(
        new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
            onListItemClick((ListView) parent, v, position);
          }
        });
    listView.setOnLongClickListener(
        new View.OnLongClickListener() {
          @Override
          public boolean onLongClick(View v) {
            // We don't actually do anything differently on long-clicks, but setting the listener
            // enables the selector transition that we have for visual consistency with the
            // Facebook app's pickers.
            return false;
          }
        });
    listView.setOnScrollListener(onScrollListener);

    activityCircle = (ProgressBar) view.findViewById(R.id.com_facebook_picker_activity_circle);

    setupViews(view);

    listView.setAdapter(adapter);

    return view;
  }
  @Override
  public void onDetach() {
    super.onDetach();

    listView.setOnScrollListener(null);
    listView.setAdapter(null);

    loadingStrategy.detach();
    sessionTracker.stopTracking();
  }