ProviderUpdateRequester
public
class
ProviderUpdateRequester
extends Object
java.lang.Object | |
↳ | androidx.wear.complications.ProviderUpdateRequester |
Allows complication providers to request update calls from the system. This effectively allows providers to push updates to the system outside of the update request cycle.
Summary
Public constructors | |
---|---|
ProviderUpdateRequester(Context context, ComponentName providerComponent)
|
Public methods | |
---|---|
void
|
requestUpdate(int... complicationIds)
Requests that the system call |
void
|
requestUpdateAll()
Requests that the system call |
Inherited methods | |
---|---|
Public constructors
ProviderUpdateRequester
public ProviderUpdateRequester (Context context, ComponentName providerComponent)
Parameters | |
---|---|
context |
Context : The provider's context |
providerComponent |
ComponentName : the component name of the ComplicationProviderService that
this will request updates for
|
Public methods
requestUpdate
public void requestUpdate (int... complicationIds)
Requests that the system call onComplicationUpdate
on the specified provider, for the given complication ids. Inactive
complications are ignored, as are complications configured to use a different provider.
Parameters | |
---|---|
complicationIds |
int : the ids of the complications to be updated, as provided in calls to
ComplicationProviderService.onComplicationActivated(int, int) and
ComplicationProviderService.onComplicationUpdate(int, ComplicationType, ComplicationProviderService.ComplicationUpdateListener) .
|
requestUpdateAll
public void requestUpdateAll ()
Requests that the system call onComplicationUpdate
on the specified provider, for all active complications using that
provider.
This will do nothing if no active complications are configured to use the specified provider.
This will also only work if called from the same package as the provider.