Search in sources :

Example 6 with MediaDatabase

use of org.videolan.vlc.media.MediaDatabase in project vlc-android by GeoffreyMetais.

the class NetworkBrowserFragment method toggleFavorite.

public void toggleFavorite() {
    final MediaDatabase db = MediaDatabase.getInstance();
    if (db.networkFavExists(mCurrentMedia.getUri()))
        db.deleteNetworkFav(mCurrentMedia.getUri());
    else
        db.addNetworkFavItem(mCurrentMedia.getUri(), mCurrentMedia.getTitle(), mCurrentMedia.getArtworkURL());
    final Activity activity = getActivity();
    if (activity != null)
        activity.invalidateOptionsMenu();
}
Also used : Activity(android.app.Activity) MediaDatabase(org.videolan.vlc.media.MediaDatabase)

Aggregations

MediaDatabase (org.videolan.vlc.media.MediaDatabase)6 Uri (android.net.Uri)2 MediaWrapper (org.videolan.medialibrary.media.MediaWrapper)2 Activity (android.app.Activity)1