DataSourcesRequest.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

# DataSourcesRequest.Builder

extends Object

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

## Class Overview

Builder used to create new DataSourceRequests.

## Summary

Public Constructors
| DataSourcesRequest.Builder()

Public Methods
DataSourcesRequest | build() Finishes building and returns the request.
DataSourcesRequest.Builder | setDataSourceTypes(int... dataSourceTypes) Sets the data source types that should be searched for in the data sources request.
DataSourcesRequest.Builder | setDataTypes(DataType... dataTypes) Sets the desired data types to search for on the data sources request.

[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 DataSourcesRequest.Builder ()

## Public Methods

#### public DataSourcesRequest build ()

Finishes building and returns the request.

##### Throws

IllegalStateException | if the builder doesn't have enough data to build a valid request

#### public DataSourcesRequest.Builder setDataSourceTypes (int... dataSourceTypes)

Sets the data source types that should be searched for in the data sources request. By default the data sources request will search for all source types. Use this method if you'd like to restrict the search to only raw or only derived data sources. Calling this method multiple times will override the previous calls.

##### Parameters

dataSourceTypes | a varargs array representing the types of data sources we're searching for. Each can be specified as one of the type constants from `DataSource`.

#### public DataSourcesRequest.Builder setDataTypes (DataType... dataTypes)

Sets the desired data types to search for on the data sources request. At least one data type should be set, or `build()` will throw an exception.

##### Parameters

dataTypes | the data types to search for. These can be one of the data types listed in `DataType`, or a custom data type.