com.google.android.gms.drive.events.DriveEvent |
![]()
|
Base interface implemented by all Drive event types. An application can express interest in receiving events by adding an event listener or subscription.
An event listener implements the DriveEvent.Listener
interface for a particular event type and
receives a direct callback from the Drive service to a client application that is
currently connected. A listener is added by calling the appropriate
add
method on the DriveResource
of interest or on
DriveApi
for listeners that are not resource-specific. Listeners are active for the
duration of the current connection or until the remove
method is
called on the same entity with the same callback parameter.
An event subscription is used to indicate that an application is interested in receiving events
via intents, even if the application is not currently connected or even running. A subscription
is added by calling the appropriate
add
method on the DriveResource
of interest or on
DriveApi
for subscriptions that are not resource-specific, passing the class name of an
exported DriveEventService
subclass that will process the event intents delivered as a
result of the subscription. Subscriptions are active until the
remove
method is called on the same entity with the same service
class or until the next device reboot. An application that is interested in maintaining any
subscriptions across reboots should handle the
ACTION_BOOT_COMPLETED
intent to add back these subscriptions after
the reboot has completed.
A client can have both listeners and subscriptions active for a given resource at the same time. When an event is raised, the Drive service will have a preference for delivering events to listeners over subscriptions. If an event is delivered to successfully to one or more listeners for a connected client, then the event will not be delivered to any active subscriptions for the same client application. An event can be delivered to multiple listeners or multiple subscribers for a given application but never to both.
Nested Classes | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DriveEvent.Listener<E extends DriveEvent> | Listens for Drive events of a particular type. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | TYPE_CHANGE | Event type that indicates a resource change. |
[Expand]
Inherited Constants | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]()
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the id of the Drive resource that triggered the event, or
null if not
resource-specific. | |||||||||||
Returns the type of an event.
|
[Expand]
Inherited Methods | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns the id of the Drive resource that triggered the event, or null
if not
resource-specific.
Returns the type of an event. See the TYPE_*
constants for possible values.