Exemplo n.º 1
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setHasOptionsMenu(true);
   adapter = new PlaylistAdapter(getActivity());
   dbHelper = DatabaseHelper.getInstance(getActivity());
   List<Playlist> playlists = dbHelper.getAllPlaylist();
   for (int i = 0; i < playlists.size(); i++) {
     adapter.add(playlists.get(i));
   }
   setListAdapter(adapter);
   ((MainActivity) getActivity()).setActionBarTitle(PLAYLIST_FRAGMENT_TITLE);
 }
Exemplo n.º 2
0
 public void addPlaylist(Playlist playlist) {
   adapter.add(playlist);
   adapter.notifyDataSetChanged();
 }