SliceLiveData
@RequiresApi(value = 19)
class SliceLiveData
Class with factory methods for creating LiveData that observes slices.
Summary
Nested types |
|---|
|
Implementation of |
interface SliceLiveData.OnErrorListenerListener for errors when using |
@IntDef(value = ) |
Public functions |
|
|---|---|
java-static SliceLiveData.CachedSliceLiveData |
fromCachedSlice(Same as |
java-static LiveData<Slice!> |
fromIntent(context: Context, intent: Intent)Produces a |
java-static LiveData<Slice!> |
fromIntent(Produces a |
java-static LiveData<Slice!> |
fromStream(Produces a |
java-static LiveData<Slice!> |
Produces a |
java-static LiveData<Slice!> |
fromUri(Produces a |
Public functions
fromCachedSlice
java-static fun fromCachedSlice(
context: Context,
input: InputStream,
listener: SliceLiveData.OnErrorListener!
): SliceLiveData.CachedSliceLiveData
Same as fromStream except returns as type CachedSliceLiveData.
fromIntent
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
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
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
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
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.