List of usage examples for android.media.browse MediaBrowser subscribe
public void subscribe(@NonNull String parentId, @NonNull SubscriptionCallback callback)
From source file:com.orangesoft.jook.ui.tv.TvVerticalGridFragment.java
protected void setMediaId(String mediaId) { Log.d(TAG, "setMediaId: " + mediaId); if (TextUtils.equals(this.mediaId, mediaId)) return;/*from w w w . j a v a2s. c om*/ MediaBrowser mediaBrowser = mediaFragmentListener.getMediaBrowser(); if (this.mediaId != null) mediaBrowser.unsubscribe(mediaId); if (null == mediaId) mediaId = mediaBrowser.getRoot(); this.mediaId = mediaId; mediaBrowser.subscribe(this.mediaId, subscriptionCallback); }
From source file:com.example.android.spotifystreamer.ui.tv.TvVerticalGridFragment.java
protected void setMediaId(String mediaId) { LogHelper.d(TAG, "setMediaId: ", mediaId); if (TextUtils.equals(mMediaId, mediaId)) { return;/* w w w . j a v a 2s . c o m*/ } MediaBrowser mediaBrowser = mMediaFragmentListener.getMediaBrowser(); // First, unsubscribe from old mediaId: if (mMediaId != null) { mediaBrowser.unsubscribe(mMediaId); } if (mediaId == null) { mediaId = mediaBrowser.getRoot(); } mMediaId = mediaId; mediaBrowser.subscribe(mMediaId, mSubscriptionCallback); }