SliceLiveData

@RequiresApi(value = 19)
class SliceLiveData


Class with factory methods for creating LiveData that observes slices.

See also
fromUri
LiveData

Summary

Nested types

Implementation of LiveDatathat provides controls over how cached vs live slices work.

Listener for errors when using fromStream.

@IntDef(value = )
@Retention(value = RetentionPolicy.SOURCE)
annotation SliceLiveData.OnErrorListener.ErrorType

Public functions

java-static SliceLiveData.CachedSliceLiveData
fromCachedSlice(
    context: Context,
    input: InputStream,
    listener: SliceLiveData.OnErrorListener!
)

Same as fromStream except returns as type CachedSliceLiveData.

java-static LiveData<Slice!>
fromIntent(context: Context, intent: Intent)

Produces a LiveData that tracks a Slice for a given Intent.

java-static LiveData<Slice!>
fromIntent(
    context: Context,
    intent: Intent,
    listener: SliceLiveData.OnErrorListener?
)

Produces a LiveData that tracks a Slice for a given Intent.

java-static LiveData<Slice!>
fromStream(
    context: Context,
    input: InputStream,
    listener: SliceLiveData.OnErrorListener!
)

Produces a LiveData that tracks a Slice for a given InputStream.

java-static LiveData<Slice!>
fromUri(context: Context, uri: Uri)

Produces a LiveData that tracks a Slice for a given Uri.

java-static LiveData<Slice!>
fromUri(
    context: Context,
    uri: Uri,
    listener: SliceLiveData.OnErrorListener?
)

Produces a LiveData that tracks a Slice for a given Uri.

Public functions

fromCachedSlice

Added in 1.1.0-alpha02
java-static fun fromCachedSlice(
    context: Context,
    input: InputStream,
    listener: SliceLiveData.OnErrorListener!
): SliceLiveData.CachedSliceLiveData

Same as fromStream except returns as type CachedSliceLiveData.

fromIntent

Added in 1.1.0-alpha02
java-static fun fromIntent(context: Context, intent: Intent): LiveData<Slice!>

Produces a LiveData that tracks a Slice for a given Intent. To use this method your app must have the permission to the slice Uri.

fromIntent

Added in 1.1.0-alpha02
java-static fun fromIntent(
    context: Context,
    intent: Intent,
    listener: SliceLiveData.OnErrorListener?
): LiveData<Slice!>

Produces a LiveData that tracks a Slice for a given Intent. To use this method your app must have the permission to the slice Uri.

fromStream

Added in 1.1.0-alpha02
java-static fun fromStream(
    context: Context,
    input: InputStream,
    listener: SliceLiveData.OnErrorListener!
): LiveData<Slice!>

Produces a LiveData that tracks a Slice for a given InputStream. To use this method your app must have the permission to the slice Uri. This will not ask the hosting app for a slice immediately, instead it will display the slice passed in through the input. When the user interacts with the slice, then the app will be started to obtain the current slice and trigger the user action.

fromUri

Added in 1.1.0-alpha02
java-static fun fromUri(context: Context, uri: Uri): LiveData<Slice!>

Produces a LiveData that tracks a Slice for a given Uri. To use this method your app must have the permission to the slice Uri.

fromUri

Added in 1.1.0-alpha02
java-static fun fromUri(
    context: Context,
    uri: Uri,
    listener: SliceLiveData.OnErrorListener?
): LiveData<Slice!>

Produces a LiveData that tracks a Slice for a given Uri. To use this method your app must have the permission to the slice Uri.