public class

MediaLibraryService.LibraryResult

extends CustomVersionedParcelable

implements androidx.media2.RemoteResult

 java.lang.Object

androidx.versionedparcelable.CustomVersionedParcelable

↳androidx.media2.MediaLibraryService.LibraryResult

Overview

Result class to be used with for asynchronous calls.

Summary

Constructors
publicLibraryResult(int resultCode)

Constructor only with the result code.

publicLibraryResult(int resultCode, java.util.List<MediaItem> items, MediaLibraryService.LibraryParams params)

Constructor with the result code and a list of media items.

publicLibraryResult(int resultCode, MediaItem item, MediaLibraryService.LibraryParams params)

Constructor with the result code and a media item.

Methods
public longgetCompletionTime()

public MediaItemgetMediaItem()

public intgetResultCode()

public voidonPostParceling()

public voidonPreParceling(boolean isStream)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public LibraryResult(int resultCode)

Constructor only with the result code.

For success, use other constructor that you can also return the result.

Parameters:

resultCode: result code

public LibraryResult(int resultCode, MediaItem item, MediaLibraryService.LibraryParams params)

Constructor with the result code and a media item.

Parameters:

resultCode: result code
item: a media item. Can be null for error
params: optional library params to describe the returned media item

public LibraryResult(int resultCode, java.util.List<MediaItem> items, MediaLibraryService.LibraryParams params)

Constructor with the result code and a list of media items.

Parameters:

resultCode: result code
items: list of media items. Can be null for error
params: optional library params to describe the returned list of media items.

Methods

public int getResultCode()

public long getCompletionTime()

public MediaItem getMediaItem()

public void onPreParceling(boolean isStream)

public void onPostParceling()