AppWidgetHostState

class AppWidgetHostState(providerInfo: AppWidgetProviderInfo?, state: MutableState<AppWidgetHostView?>)

State for the AppWidgetHost that holds the host view and allows to update the appwidget.

See also

Constructors

AppWidgetHostState
Link copied to clipboard
fun AppWidgetHostState(providerInfo: AppWidgetProviderInfo?, state: MutableState<AppWidgetHostView?>)

Functions

updateAppWidget
Link copied to clipboard
fun updateAppWidget(remoteViews: RemoteViews)
Update the current host (if available) to display the provided RemoteViews

Properties

isReady
Link copied to clipboard
val isReady: Boolean
True if the host is ready to display RemoteViews, false otherwise
providerInfo
Link copied to clipboard
val providerInfo: AppWidgetProviderInfo?
snapshot
Link copied to clipboard
var snapshot: RemoteViews? = null
Holds the last snapshot provided to the host or null if none
value
Link copied to clipboard
var value: AppWidgetHostView?
The current AppWidgetHostView instance or null if not laid out yet.

Extensions

requestPin
Link copied to clipboard
fun AppWidgetHostState.requestPin(target: ComponentName = value!!.appWidgetInfo.provider, successCallback: PendingIntent? = null): Boolean
Request the launcher to pin the current hosted appwidget if any.