Example usage for android.media.browse MediaBrowser isConnected

List of usage examples for android.media.browse MediaBrowser isConnected

Introduction

In this page you can find the example usage for android.media.browse MediaBrowser isConnected.

Prototype

public boolean isConnected() 

Source Link

Document

Returns whether the browser is connected to the service.

Usage

From source file:com.orangesoft.jook.ui.tv.TvVerticalGridFragment.java

@Override
public void onStop() {
    super.onStop();
    MediaBrowser mediaBrowser = mediaFragmentListener.getMediaBrowser();
    if (mediaBrowser != null && mediaBrowser.isConnected() && mediaId != null)
        mediaBrowser.unsubscribe(mediaId);
}

From source file:com.example.android.spotifystreamer.ui.tv.TvVerticalGridFragment.java

@Override
public void onStop() {
    super.onStop();
    MediaBrowser mediaBrowser = mMediaFragmentListener.getMediaBrowser();
    if (mediaBrowser != null && mediaBrowser.isConnected() && mMediaId != null) {
        mediaBrowser.unsubscribe(mMediaId);
    }/*  w  w  w .  j  av a2  s .c  o m*/
}

From source file:com.misterpereira.android.kiteplayer.ui.MediaBrowserFragment.java

@Override
public void onStop() {
    super.onStop();
    MediaBrowser mediaBrowser = mMediaFragmentListener.getMediaBrowser();
    if (mediaBrowser != null && mediaBrowser.isConnected() && mMediaId != null) {
        mediaBrowser.unsubscribe(mMediaId);
    }//from   w w w  .  j  a  v  a  2  s  . c  om
    if (getActivity().getMediaController() != null) {
        getActivity().getMediaController().unregisterCallback(mMediaControllerCallback);
    }
    this.getActivity().unregisterReceiver(mConnectivityChangeReceiver);
}

From source file:com.misterpereira.android.kiteplayer.ui.MediaBrowserFragment.java

@Override
public void onStart() {
    super.onStart();

    // fetch browsing information to fill the listview:
    MediaBrowser mediaBrowser = mMediaFragmentListener.getMediaBrowser();

    LogHelper.d(TAG, "fragment.onStart, mediaId=", mMediaId, "  onConnected=" + mediaBrowser.isConnected());

    if (mediaBrowser.isConnected()) {
        onConnected();//w  w  w  .j  a va  2 s  .  c  o m
    }

    // Registers BroadcastReceiver to track network connection changes.
    this.getActivity().registerReceiver(mConnectivityChangeReceiver,
            new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
}