Example usage for android.support.v4.media MediaBrowserCompat MediaBrowserCompat

List of usage examples for android.support.v4.media MediaBrowserCompat MediaBrowserCompat

Introduction

In this page you can find the example usage for android.support.v4.media MediaBrowserCompat MediaBrowserCompat.

Prototype

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

Source Link

Document

Creates a media browser for the specified media browse service.

Usage

From source file:com.bayapps.android.robophish.ui.tv.TvPlaybackActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LogHelper.d(TAG, "Activity onCreate");

    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class),
            mConnectionCallback, null);/*from w w w  . ja v a 2 s .c  om*/

    setContentView(R.layout.tv_playback_controls);

    mPlaybackFragment = (TvPlaybackFragment) getSupportFragmentManager()
            .findFragmentById(R.id.playback_controls_fragment);
}

From source file:com.example.chu.googleplaylibrary.ui.BaseActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LogHelper.d(TAG, "Activity onCreate");

    // Connect a media browser just to get the media session token. There are other ways
    // this can be done, for example by sharing the session token directly.
    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class),
            mConnectionCallback, null);/* w ww. ja  va 2s. com*/
}

From source file:com.bayapps.android.robophish.ui.tv.TvVerticalGridActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tv_vertical_grid);

    mMediaId = getIntent().getStringExtra(TvBrowseActivity.SAVED_MEDIA_ID);
    mTitle = getIntent().getStringExtra(TvBrowseActivity.BROWSE_TITLE);

    getWindow().setBackgroundDrawableResource(R.drawable.bg);

    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class),
            mConnectionCallback, null);/*from   w ww .  j  a v a  2 s . co  m*/
}

From source file:com.bayapps.android.robophish.ui.tv.TvBrowseActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LogHelper.d(TAG, "Activity onCreate");

    setContentView(R.layout.tv_activity_player);

    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class),
            mConnectionCallback, null);/*from  w w w .j  ava 2 s . c om*/
}

From source file:com.classiqo.nativeandroid_32bitz.ui.BaseActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LogHelper.d(TAG, "Activity onCreate");

    if (Build.VERSION.SDK_INT >= 21) {
        ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getTitle().toString(),
                BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_white),
                ResourceHelper.getThemeColor(this, R.attr.colorPrimary, android.R.color.darker_gray));
        setTaskDescription(taskDesc);//from   ww w  .  j  ava  2s. c  o  m
    }

    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class),
            mConnectionCallback, null);
}

From source file:rocks.stalin.android.app.ui.BaseActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LogHelper.d(TAG, "Activity onCreate");

    // Since our app icon has the same color as colorPrimary, our entry in the Recent Apps
    // list gets weird. We need to change either the icon or the color
    // of the TaskDescription.
    ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getTitle().toString(),
            BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_white),
            ResourceHelper.getThemeColor(this, R.attr.colorPrimary, android.R.color.darker_gray));
    setTaskDescription(taskDesc);//from   w w  w  .ja  va2  s  .  co m

    // Connect a media browser just to get the media session token. There are other ways
    // this can be done, for example by sharing the session token directly.
    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class),
            mConnectionCallback, null);
}

From source file:com.mts2792.music.uamp.ui.BaseActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LogHelper.d(TAG, "Activity onCreate");

    if (Build.VERSION.SDK_INT >= 21) {
        // Since our app icon has the same color as colorPrimary, our entry in the Recent Apps
        // list gets weird. We need to change either the icon or the color
        // of the TaskDescription.
        ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getTitle().toString(),
                BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_white),
                ResourceHelper.getThemeColor(this, R.attr.colorPrimary, android.R.color.darker_gray));
        setTaskDescription(taskDesc);//from   w  w  w .j  a  va  2  s .  c o m
    }

    // Connect a media browser just to get the media session token. There are other ways
    // this can be done, for mts2792 by sharing the session token directly.
    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class),
            mConnectionCallback, null);
}

From source file:com.example.android.AudioArchive.ui.BaseActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LogHelper.d(TAG, "Activity onCreate");

    if (Build.VERSION.SDK_INT >= 21) {
        // Since our app icon has the same color as colorPrimary, our entry in the Recent Apps
        // list gets weird. We need to change either the icon or the color
        // of the TaskDescription.
        ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getTitle().toString(),
                BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_white),
                ResourceHelper.getThemeColor(this, R.attr.colorPrimary, android.R.color.darker_gray));
        setTaskDescription(taskDesc);//  w  w w  .  j  a  v  a  2  s. co  m
    }

    // Connect a media browser just to get the media session token. There are other ways
    // this can be done, for example by sharing the session token directly.
    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class),
            mConnectionCallback, null);
}

From source file:com.example.lzhang.stockchartt.media.ui.BaseActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LogHelper.d(TAG, "Activity onCreate");

    if (Build.VERSION.SDK_INT >= 21) {
        // Since our app icon has the same color as colorPrimary, our entry in the Recent Apps
        // list gets weird. We need to change either the icon or the color
        // of the TaskDescription.
        //            ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(
        //                    getTitle().toString(),
        //                    BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_white),
        //                    ResourceHelper.getThemeColor(this, R.attr.colorPrimary,
        //                            android.R.color.darker_gray));
        //            setTaskDescription(taskDesc);
    }/* ww w. j  a v  a  2  s  .  c om*/

    // Connect a media browser just to get the media session token. There are other ways
    // this can be done, for example by sharing the session token directly.
    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class),
            mConnectionCallback, null);
}

From source file:com.livemasjid.livemasjidandroid.ui.BaseActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LogHelper.d(TAG, "Activity onCreate");

    /*if (Build.VERSION.SDK_INT >= 21) {
    // Since our app icon has the same color as colorPrimary, our entry in the Recent Apps
    // list gets weird. We need to change either the icon or the color
    // of the TaskDescription.//from w  ww.j  a  v  a 2s  .  c  om
    ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(
            getTitle().toString(),
            BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_white),
            ResourceHelper.getThemeColor(this, R.attr.colorPrimary,
                    android.R.color.darker_gray));
    setTaskDescription(taskDesc);
    }*/

    // Connect a media browser just to get the media session token. There are other ways
    // this can be done, for example by sharing the session token directly.
    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class),
            mConnectionCallback, null);
}