DataDeleteRequest.Builder | 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: Ctors | Methods | Inherited Methods | [Expand All]
public static class

# DataDeleteRequest.Builder

extends Object

java.lang.Object
↳ | com.google.android.gms.fitness.request.DataDeleteRequest.Builder

## Class Overview

Builder used to create new DataDeleteRequests.

## Summary

Public Constructors
| DataDeleteRequest.Builder()

Public Methods
DataDeleteRequest.Builder | addDataSource(DataSource dataSource) Adds a specific data source to delete data from the Google Fit store.
DataDeleteRequest.Builder | addDataType(DataType dataType) Adds a specific data type to delete data from the Google Fit store.
DataDeleteRequest.Builder | addSession(Session session) Adds a specific session to delete from the Google Fit store.
DataDeleteRequest | build() Finishes building and returns the request.
DataDeleteRequest.Builder | deleteAllData() Adds option to delete data for all data types.
DataDeleteRequest.Builder | deleteAllSessions()
DataDeleteRequest.Builder | setTimeInterval(long startTime, long endTime, TimeUnit timeUnit) Sets the time interval for the data delete query.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Public Constructors

#### public DataDeleteRequest.Builder ()

## Public Methods

#### public DataDeleteRequest.Builder addDataSource (DataSource dataSource)

Adds a specific data source to delete data from the Google Fit store. Apps can either use this function or use `addDataType(DataType)` to add a specific data type, or use `deleteAllData()` to mark data for all data types to be deleted.

##### Throws

IllegalArgumentException | if the input data source is invalid or if all data is already marked for deletion

#### public DataDeleteRequest.Builder addDataType (DataType dataType)

Adds a specific data type to delete data from the Google Fit store. Apps can either use this function or use `addDataSource(DataSource)` to add a specific data source, or use `deleteAllData()` to mark data for all data types to be deleted.

##### Throws

IllegalArgumentException | if invalid data type is specified or if all data is already marked for deletion

#### public DataDeleteRequest.Builder addSession (Session session)

Adds a specific session to delete from the Google Fit store. Apps can either use this function or use `deleteAllSessions()` to mark all sessions for deletion. Only sessions that have already ended can be marked for deletion.

##### Throws

IllegalArgumentException | if the input session is invalid or is still ongoing, or if all sessions are already marked for deletion

#### public DataDeleteRequest build ()

Finishes building and returns the request.

##### Throws

IllegalStateException | if time interval is not set or if input sessions are outside the query time interval, or if no data or session is marked for deletion

#### public DataDeleteRequest.Builder deleteAllData ()

Adds option to delete data for all data types. Apps can either use this function to delete all data or specify a specific data source using `addDataSource(DataSource)` or a specific data type using `addDataType(DataType)` for data deletion.

##### Throws

IllegalArgumentException | if a specific data source/type is already added for deletion

#### public DataDeleteRequest.Builder deleteAllSessions ()

#### public DataDeleteRequest.Builder setTimeInterval (long startTime, long endTime, TimeUnit timeUnit)

Sets the time interval for the data delete query.

##### Throws

IllegalArgumentException | if the input time interval is invalid.