Example usage for android.media.browse MediaBrowser MediaBrowser

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

Introduction

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

Prototype

public MediaBrowser(Context context, ComponentName serviceComponent, ConnectionCallback callback,
        Bundle rootHints) 

Source Link

Document

Creates a media browser for the specified media browser service.

Usage

From source file:com.example.android.musicbrowserdemo.BrowserListFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    Log.d(TAG, "onActivityCreated -- " + hashCode());
    mAdapter = new Adapter();
    setListAdapter(mAdapter);//ww w  .j av a 2  s.  c o  m

    // Get our arguments
    final Bundle args = getArguments();
    mComponent = args.getParcelable(ARG_COMPONENT);
    mNodeId = args.getString(ARG_ID);

    // A hint about who we are, so the service can customize the results if it wants to.
    final Bundle rootHints = new Bundle();
    rootHints.putBoolean(HINT_DISPLAY, true);

    mBrowser = new MediaBrowser(getActivity(), mComponent, mConnectionCallbacks, rootHints);
}