Exemple #1
0
 public void onEvent(Msg event) {
   switch (event.getEvent()) {
     case UPDATE_GAMES:
       mAdapter.clear();
       mAdapter.addAll(DbUtilities.getGames());
   }
 }
Exemple #2
0
  public void onActivityCreated(Bundle bundle) {
    super.onActivityCreated(bundle);

    View view = getView();

    mAdapter =
        new EnvoyAdapter(
            getActivity(),
            new ArrayList<>(DbUtilities.getGames()),
            EnvoyAdapter.RATE_GAMES_ADAPTER);

    mListView = (ListView) view.findViewById(android.R.id.list);
    mListView.setOnItemClickListener(this);
    mListView.setAdapter(mAdapter);

    TextView emptyText = (TextView) view.findViewById(android.R.id.empty);
    mListView.setEmptyView(emptyText);
  }