@Override
 public void onPayClicked(int position) {
   PeopleDatabase database = new PeopleDatabase(getContext());
   database.open();
   int id = (int) adapter.getItemId(position);
   database.makePersonPay(id, mGroup.getId());
   mGroup.setPeople(database.getPeopleForGroup(mGroup.getId()));
   database.close();
   adapter.notifyDataSetChanged();
 }
 @Override
 public void onFinishEditDialog(String inputText) {
   PeopleDatabase db = new PeopleDatabase(getContext());
   db.open();
   db.addPersonToGroup(mGroup.getId(), inputText);
   mGroup.setPeople(db.getPeopleForGroup(mGroup.getId()));
   db.close();
   adapter.notifyDataSetChanged();
 }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_group_detail, container, false);

    if (mGroup != null) {
      RecyclerView personList = (RecyclerView) rootView.findViewById(R.id.people_list);
      personList.setLayoutManager(new LinearLayoutManager(getActivity()));
      adapter = new PeopleAdapter(getActivity(), mGroup.getPeople(), this);
      Log.d("GroupDetailFragment", "There are " + adapter.getItemCount() + " items in the adapter");
      adapter.notifyDataSetChanged();
      personList.setAdapter(adapter);

      //            ((TextView)
      // rootView.findViewById(R.id.group_detail)).setText(mGroup.getLastUsed().toString());
    }

    return rootView;
  }