本文整理汇总了Java中android.support.v4.media.MediaBrowserCompat.connect方法的典型用法代码示例。如果您正苦于以下问题:Java MediaBrowserCompat.connect方法的具体用法?Java MediaBrowserCompat.connect怎么用?Java MediaBrowserCompat.connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.media.MediaBrowserCompat
的用法示例。
在下文中一共展示了MediaBrowserCompat.connect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MediaInterface
import android.support.v4.media.MediaBrowserCompat; //导入方法依赖的package包/类
public MediaInterface(FragmentActivity activity, MediaId mediaId, MediaInterfaceCallback callback) {
mFragmentActivity = activity;
mCallbacks = callback;
mPlayerControls = new MediaPlayerController(mediaId);
mPlayerControls.setMediaControls(mCallbacks, null);
mMediaBrowser = new MediaBrowserCompat(activity.getApplicationContext(),
new ComponentName(activity, MediaService.class),
new MediaBrowserCompat.ConnectionCallback() {
@Override
public void onConnected() {
MediaInterface.this.onConnected();
}
}, null);
mMediaBrowser.connect();
mSurfaceId = SURFACE_ID.incrementAndGet();
if (SURFACE_ID.longValue() == Long.MAX_VALUE)
SURFACE_ID.set(1);
}
示例2: onStart
import android.support.v4.media.MediaBrowserCompat; //导入方法依赖的package包/类
@Override
public void onStart() {
super.onStart();
mMediaBrowser =
new MediaBrowserCompat(
this,
new ComponentName(this, MusicService.class),
mConnectionCallback,
null);
mMediaBrowser.connect();
}
示例3: onCreate
import android.support.v4.media.MediaBrowserCompat; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
fontBold = Typeface.createFromAsset(getAssets(), "fonts/russia-bold.ttf");
fontNormal = Typeface.createFromAsset(getAssets(), "fonts/russia-normal.ttf");
fontLight = Typeface.createFromAsset(getAssets(), "fonts/russia-light.ttf");
mediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MediaPlayerService.class), connectionCallbacks, null);
mediaBrowser.connect();
}