DriveEvent | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Inherited Constants | Inherited Methods | [Expand All]
public interface

# DriveEvent

implements Parcelable

com.google.android.gms.drive.events.DriveEvent

Known Indirect Subclasses ChangeEvent, CompletionEvent, ResourceEvent
ChangeEvent | Sent when a `DriveResource` has had a change to its `DriveContents` or `Metadata`.
CompletionEvent | An event delivered after the client requests a completion notification using `setNotifyOnCompletion(boolean)` and that action has either succeeded or failed on the server.
ResourceEvent | Base interface for `DriveEvent` types related to a specific resource.

## Class Overview

Base interface implemented by all Drive event types. An application can express interest in receiving events by adding an event listener or declaring an event listener service.

An event listener implements the listener interface for a particular event type and receives a direct callback from the Drive service to the client application that is currently connected. A listener is added by calling the appropriate `addListener` method on the `DriveResource` of interest. Listeners are active for the duration of the current connection or until the `removeListener` method is called on the same entity with the same callback parameter.

An event service must be declared in an application's manifest to indicate that an application is interested in receiving events via bound service AIDL calls on the event service, even if the application is not currently connected or even running.

A subscription is added by calling the appropriate `addSubscription` method on the `DriveResource` of interest. Subscriptions are active until the `removeSubscription` method is called on the same entity 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.

Some event types will also support the ability to request event delivery using the `ExecutionOptions` parameter that is passed to a Drive API call. This will indicate that the requested events be delivered to the event service for as long as the operation is active, i.e. until it has successfully completed or permanently failed.

Events will be delivered to all registered listeners, subscribers, and/or enabled operations that match the event. The same event may be delivered to more than one listener or service when appropriate.

## Summary

[Expand] Inherited Constants
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

[Expand] Inherited Methods
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)