# ProviderChooserIntent

Summary:[Constants](https://developer.android.com/reference/android/support/wearable/complications/ProviderChooserIntent#constants)\|[Methods](https://developer.android.com/reference/android/support/wearable/complications/ProviderChooserIntent#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/wearable/complications/ProviderChooserIntent#inhmethods)  

# ProviderChooserIntent

`
public


class
ProviderChooserIntent
`  
`

extends `[Object](http://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|--------------------------------------------------------------|
| [java.lang.Object](http://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.wearable.complications.ProviderChooserIntent |

<br />

*** ** * ** ***

<br />

**This class is deprecated.**   
use the[Jetpack Wear Watch Face](https://developer.android.com/jetpack/androidx/releases/wear-watchface)libraries instead.

Utilities to allow watch faces to launch the complication provider chooser.

## Summary

|                                                                                                                                                                     ### Constants                                                                                                                                                                     ||
|------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](http://developer.android.com/reference/java/lang/String.html) | [EXTRA_PROVIDER_INFO](https://developer.android.com/reference/android/support/wearable/complications/ProviderChooserIntent.html#EXTRA_PROVIDER_INFO) Key for an extra used to include details of the chosen provider in the activity result returned by the provider chooser. |

|                                                                                                                                                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                                                                                                                                                      ||
|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[Intent](http://developer.android.com/reference/android/content/Intent.html) | ` `[createProviderChooserIntent](https://developer.android.com/reference/android/support/wearable/complications/ProviderChooserIntent.html#createProviderChooserIntent(android.content.ComponentName,%20int,%20int...))`(`[ComponentName](http://developer.android.com/reference/android/content/ComponentName.html)` watchFace, int watchFaceComplicationId, int... supportedTypes) ` Returns an intent that may be used to start an activity to allow the user to select a provider for the given complication.                                                                                   |
| ` static void`                                                                         | ` `[startProviderChooserActivity](https://developer.android.com/reference/android/support/wearable/complications/ProviderChooserIntent.html#startProviderChooserActivity(android.content.Context,%20android.content.ComponentName,%20int,%20int...))`(`[Context](http://developer.android.com/reference/android/content/Context.html)` context, `[ComponentName](http://developer.android.com/reference/android/content/ComponentName.html)` watchFace, int watchFaceComplicationId, int... supportedTypes) ` Starts an activity to allow the user to select a provider for the given complication. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](http://developer.android.com/reference/java/lang/Object.html)` ` |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| | ` `[Object](http://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                               | | ` boolean`                                                                         | ` equals(`[Object](http://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                            | ` finalize() `                                                                            | | ` final `[Class](http://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                            | | ` int`                                                                             | ` hashCode() `                                                                            | | ` final void`                                                                      | ` notify() `                                                                              | | ` final void`                                                                      | ` notifyAll() `                                                                           | | ` `[String](http://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                            | | ` final void`                                                                      | ` wait(long arg0, int arg1) `                                                             | | ` final void`                                                                      | ` wait(long arg0) `                                                                       | | ` final void`                                                                      | ` wait() `                                                                                | ||

## Constants

### EXTRA_PROVIDER_INFO

```
public static final String EXTRA_PROVIDER_INFO
```

Key for an extra used to include details of the chosen provider in the activity result returned by the provider chooser.

<br />

**See also:**

- [createProviderChooserIntent(ComponentName, int, int...)](https://developer.android.com/reference/android/support/wearable/complications/ProviderChooserIntent.html#createProviderChooserIntent(android.content.ComponentName,%20int,%20int...))

Constant Value: "android.support.wearable.complications.EXTRA_PROVIDER_INFO"

## Public methods

### createProviderChooserIntent

```
public static Intent createProviderChooserIntent (ComponentName watchFace, 
                int watchFaceComplicationId, 
                int... supportedTypes)
```

Returns an intent that may be used to start an activity to allow the user to select a provider for the given complication. The activity will show a list of all providers that can supply data of at least one of the`supportedTypes`.

This should only be used if the user has already granted the`com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA`permission. In most cases it will be easier to use[ComplicationHelperActivity](https://developer.android.com/reference/android/support/wearable/complications/ComplicationHelperActivity.html)to perform the permission request automatically if it is not already granted.

When the user chooses a provider, the configuration will be set up in the complications system - the watch face does not need to do anything else.

The activity must be started using[Activity.startActivityForResult(Intent, int)](http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent,%20int)), or else this will not work. The result delivered back to your activity will have a result code of[RESULT_OK](http://developer.android.com/reference/android/app/Activity.html#RESULT_OK)if a provider was successfully set, or a result code of[RESULT_CANCELED](http://developer.android.com/reference/android/app/Activity.html#RESULT_CANCELED)if no provider was set. In the case where a provider was set,[ComplicationProviderInfo](https://developer.android.com/reference/android/support/wearable/complications/ComplicationProviderInfo.html)for the chosen provider will be included in the data intent of the result, as an extra with the key[EXTRA_PROVIDER_INFO](https://developer.android.com/reference/android/support/wearable/complications/ProviderChooserIntent.html#EXTRA_PROVIDER_INFO).

The package of the calling Activity must match the package of the watch face, or this will not work.

<br />

|                                                                                                                                                                           Parameters                                                                                                                                                                            ||
|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `watchFace`               | `ComponentName`: the ComponentName of the[WatchFaceService](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html)being configured. <br />                                                                                                                                                |
| `watchFaceComplicationId` | `int`: the watch face's id for the complication being configured. This must match the id passed in when the watch face calls[WatchFaceService.Engine.setActiveComplications(int...)](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setActiveComplications(int...)). <br /> |
| `supportedTypes`          | `int`: the types supported by the complication, in decreasing order of preference. If a provider can supply data for more than one of these types, the type chosen will be whichever was specified first. <br />                                                                                                                     |

|                                       Returns                                        ||
|------------------------------------------------------------------------------|--------|
| [Intent](http://developer.android.com/reference/android/content/Intent.html) | <br /> |

**See also:**

- [ComplicationHelperActivity](https://developer.android.com/reference/android/support/wearable/complications/ComplicationHelperActivity.html)  

### startProviderChooserActivity

```
public static void startProviderChooserActivity (Context context, 
                ComponentName watchFace, 
                int watchFaceComplicationId, 
                int... supportedTypes)
```

Starts an activity to allow the user to select a provider for the given complication. The activity will show a list of all providers that can supply data of at least one of the`supportedTypes`.

This should only be used if the user has already granted the`com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA`permission. In most cases it will be easier to use[ComplicationHelperActivity](https://developer.android.com/reference/android/support/wearable/complications/ComplicationHelperActivity.html)to perform the permission request automatically if it is not already granted.

This is intended for use when starting the chooser directly from the watch face. If the chooser is being started from an Activity, use[createProviderChooserIntent(ComponentName, int, int...)](https://developer.android.com/reference/android/support/wearable/complications/ProviderChooserIntent.html#createProviderChooserIntent(android.content.ComponentName,%20int,%20int...))instead.

The package of the caller must match the package of the watch face, or this will not work.

<br />

|                                                                                                                                                                           Parameters                                                                                                                                                                            ||
|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `context`                 | `Context`: used to start the activity. <br />                                                                                                                                                                                                                                                                                        |
| `watchFace`               | `ComponentName`: the ComponentName of the[WatchFaceService](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html)being configured. <br />                                                                                                                                                |
| `watchFaceComplicationId` | `int`: the watch face's id for the complication being configured. This must match the id passed in when the watch face calls[WatchFaceService.Engine.setActiveComplications(int...)](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setActiveComplications(int...)). <br /> |
| `supportedTypes`          | `int`: the types supported by the complication, in decreasing order of preference. If a provider can supply data for more than one of these types, the type chosen will be whichever was specified first. <br />                                                                                                                     |