@Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View v = inflater.inflate(R.layout.fragment_searchable_students, container, false);

    this.list = (ListView) v.findViewById(R.id.fragStud_listViewStudents);
    this.search = (EditText) v.findViewById(R.id.fragStud_textSearch);

    search.addTextChangedListener(this);

    adapter = new StudentAddAdapter(getActivity(), lecture, list);
    adapter.load(getActivity());

    list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
    list.setAdapter(adapter);

    LectureDetailMultiChoiceListener choiceListener =
        new LectureDetailMultiChoiceListener(
            getActivity(),
            LectureDetailMultiChoiceListener.CAB_MODE_ADD_LECTURE_STUDENTS,
            list,
            adapter,
            lecture);

    choiceListener.setOnSuccessListener(
        new OnSuccessListener() {
          @Override
          public void onSuccess() {
            if (listener != null) {
              listener.onStudentsAdded();
            }
          }
        });

    list.setMultiChoiceModeListener(choiceListener);

    return v;
  }
 @Override
 public void afterTextChanged(Editable s) {
   adapter.setFilter(s.toString());
   adapter.load(getActivity());
 }
 /** Method you need to call if changes were made to the content of the student list */
 public void refreshList() {
   adapter.load(getActivity());
 }