Search in sources :

Example 1 with MediaService

use of com.owncloud.android.media.MediaService in project android by owncloud.

the class PreviewAudioFragment method bindMediaService.

private void bindMediaService() {
    Timber.d("Binding to MediaService...");
    if (mMediaServiceConnection == null) {
        mMediaServiceConnection = new MediaServiceConnection();
        getActivity().bindService(new Intent(getActivity(), MediaService.class), mMediaServiceConnection, Context.BIND_AUTO_CREATE);
    // follow the flow in MediaServiceConnection#onServiceConnected(...)
    }
}
Also used : MediaService(com.owncloud.android.media.MediaService) Intent(android.content.Intent)

Example 2 with MediaService

use of com.owncloud.android.media.MediaService in project android by nextcloud.

the class PreviewMediaFragment method bindMediaService.

private void bindMediaService() {
    Log_OC.d(TAG, "Binding to MediaService...");
    if (mMediaServiceConnection == null) {
        mMediaServiceConnection = new MediaServiceConnection();
    }
    getActivity().bindService(new Intent(getActivity(), MediaService.class), mMediaServiceConnection, Context.BIND_AUTO_CREATE);
    // follow the flow in MediaServiceConnection#onServiceConnected(...)
    ((FileDisplayActivity) getActivity()).setMediaServiceConnection();
}
Also used : FileDisplayActivity(com.owncloud.android.ui.activity.FileDisplayActivity) MediaService(com.owncloud.android.media.MediaService) Intent(android.content.Intent)

Aggregations

Intent (android.content.Intent)2 MediaService (com.owncloud.android.media.MediaService)2 FileDisplayActivity (com.owncloud.android.ui.activity.FileDisplayActivity)1