public final class

Address

extends Object
java.lang.Object
   ↳ com.google.android.gms.identity.intents.Address

Class Overview

APIs for accessing a user's address. Calling requestUserAddress(GoogleApiClient, UserAddressRequest, int) will prompt the user to select an address to share with your application.

Summary

Nested Classes
class Address.AddressOptions A class that encapsulates options for the Address APIs. 
Fields
public static final Api API Add this to your GoogleApiClient via addApi(com.google.android.gms.common.api.Api, com.google.android.gms.common.api.GoogleApiClient.ApiOptions).
Public Constructors
Address()
Public Methods
static void requestUserAddress(GoogleApiClient googleApiClient, UserAddressRequest request, int requestCode)
API to request an address from a user.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

Public Constructors

public Address ()

Public Methods

public static void requestUserAddress (GoogleApiClient googleApiClient, UserAddressRequest request, int requestCode)

API to request an address from a user. This will invoke a dialog that allows the user to decide if they want to select a single address to share your app, or alternatively decline to share an address at all. The response to this request is supplied via your Activity's onActivityResult(int, int, Intent) callback method. If the user selects an address to share, then a responseCode of RESULT_OK will be returned onActivity and you can retrieve the UserAddress from the data Intent sent to onActivityResult using the EXTRA_ADDRESS key. If the user declines to share an address, then a responseCode of RESULT_CANCELED. If there is an error retrieving addresses for the user, for example if the user has no applicable addresses, then a responseCode of RESULT_ERROR will be returned an error code can be retrieved from the data Intent using EXTRA_ERROR_CODE.

Parameters
googleApiClient used to communicate with Google Play Services. This should be configured to use API. Must not be null.
request used to specify what kind of addresses your app can handle. If null, then it is assumed that your app can handle any address.
requestCode used onActivityResult(int, int, Intent) to identify which request triggered that callback.