Ejemplo 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);
 }
Ejemplo n.º 2
0
 public void addPlaylist(Playlist playlist) {
   adapter.add(playlist);
   adapter.notifyDataSetChanged();
 }
Ejemplo n.º 3
0
 @Override
 public void onListItemClick(ListView l, View v, int position, long id) {
   super.onListItemClick(l, v, position, id);
   callback.onPlaylistSelected((Playlist) adapter.getItem(position));
 }