Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#constants) \| [Inherited Constants](https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#inhconstants) \| [Fields](https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#lfields) \| [Ctors](https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#pubctors) \| [Methods](https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#inhmethods)

# AppWidgetProviderInfo

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/appwidget/AppWidgetProviderInfo "View this page in Kotlin") \|Java


`
public


class
AppWidgetProviderInfo
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.appwidget.AppWidgetProviderInfo |

<br />

*** ** * ** ***

Describes the meta data for an installed AppWidget provider. The fields in this class
correspond to the fields in the `<appwidget-provider>` xml tag.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_BOTH` Widget is resizable in both the horizontal and vertical axes. |
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_HORIZONTAL` Widget is resizable in the horizontal axis only. |
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_NONE` Widget is not resizable. |
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_VERTICAL` Widget is resizable in the vertical axis only. |
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_HOME_SCREEN` Indicates that the widget can be displayed on the home screen. |
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_KEYGUARD` Indicates that the widget can be displayed on the keyguard. |
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_NOT_KEYGUARD` Indicates that the widget should never be shown on the keyguard. |
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_SEARCHBOX` Indicates that the widget can be displayed within a space reserved for the search box. |
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_FEATURE_CONFIGURATION_OPTIONAL` The widget provides a default configuration. |
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_FEATURE_HIDE_FROM_PICKER` The widget is added directly by the app, and the host may hide this widget when providing the user with the list of available widgets to choose from. |
| `int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_FEATURE_RECONFIGURABLE` The widget can be reconfigured anytime after it is bound by starting the `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#configure` activity. |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/android/os/Parcelable` |---|---| | `int` | `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. | | `int` | `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo>` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#CREATOR` Parcelable.Creator that instantiates AppWidgetProviderInfo objects |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#autoAdvanceViewId` The view id of the AppWidget subview which should be auto-advanced by the widget's host. |
| ` public https://developer.android.com/reference/android/content/ComponentName` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#configure` The activity to launch that will configure the AppWidget. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#descriptionRes` Resource id for the description of the AppWidget. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#generatedPreviewCategories` Flags indicating the widget categories for which generated previews are available. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#icon` The icon to display for this AppWidget in the AppWidget picker. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#initialKeyguardLayout` The resource id of the initial layout for this AppWidget when it is displayed on keyguard. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#initialLayout` The resource id of the initial layout for this AppWidget. |
| ` public https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#label` *This field was deprecated in API level 21. Use `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#loadLabel(android.content.pm.PackageManager)`.* |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#maxResizeHeight` Maximum height (in px) which the widget can be resized to. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#maxResizeWidth` Maximum width (in px) which the widget can be resized to. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#minHeight` The default height of the widget when added to a host, in px. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#minResizeHeight` Minimum height (in px) which the widget can be resized to. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#minResizeWidth` Minimum width (in px) which the widget can be resized to. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#minWidth` The default width of the widget when added to a host, in px. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#previewImage` A preview of what the AppWidget will look like after it's configured. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#previewLayout` The layout resource id of a preview of what the AppWidget will look like after it's configured. |
| ` public https://developer.android.com/reference/android/content/ComponentName` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#provider` Identity of this AppWidget component. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#resizeMode` The rules by which a widget can be resized. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#targetCellHeight` The default height of a widget when added to a host, in units of launcher grid cells. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#targetCellWidth` The default width of a widget when added to a host, in units of launcher grid cells. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#updatePeriodMillis` How often, in milliseconds, that this AppWidget wants to be updated. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#widgetCategory` Determines whether this widget can be displayed on the home screen, the keyguard, or both. |
| ` public int` | `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#widgetFeatures` Flags indicating various features supported by the widget. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#AppWidgetProviderInfo()() ` |
| ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#AppWidgetProviderInfo(android.os.Parcel)(https://developer.android.com/reference/android/os/Parcel in) ` Unflatten the AppWidgetProviderInfo from a parcel. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo` | ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#clone()() ` Creates and returns a copy of this object. |
| ` int` | ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` https://developer.android.com/reference/android/content/pm/ActivityInfo` | ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#getActivityInfo()() ` Returns the broadcast receiver that is providing this widget. |
| ` final https://developer.android.com/reference/android/os/UserHandle` | ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#getProfile()() ` Gets the user profile in which the provider resides. |
| ` final https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#loadDescription(android.content.Context)(https://developer.android.com/reference/android/content/Context context) ` Loads localized description for the app widget. |
| ` final https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#loadIcon(android.content.Context,%20int)(https://developer.android.com/reference/android/content/Context context, int density) ` Loads the icon to display for this AppWidget in the AppWidget picker. |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#loadLabel(android.content.pm.PackageManager)(https://developer.android.com/reference/android/content/pm/PackageManager packageManager) ` Loads the localized label to display to the user in the AppWidget picker. |
| ` final https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#loadPreviewImage(android.content.Context,%20int)(https://developer.android.com/reference/android/content/Context context, int density) ` Loads a preview of what the AppWidget will look like after it's configured. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel out, int flags) ` Flatten this object in to a Parcel. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||
| From interface ` https://developer.android.com/reference/android/os/Parcelable ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. | | ` abstract void` | ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### RESIZE_BOTH

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESIZE_BOTH
```

Widget is resizable in both the horizontal and vertical axes.

<br />

Constant Value:

3
(0x00000003)


### RESIZE_HORIZONTAL

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESIZE_HORIZONTAL
```

Widget is resizable in the horizontal axis only.

<br />

Constant Value:

1
(0x00000001)


### RESIZE_NONE

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESIZE_NONE
```

Widget is not resizable.

<br />

Constant Value:

0
(0x00000000)


### RESIZE_VERTICAL

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESIZE_VERTICAL
```

Widget is resizable in the vertical axis only.

<br />

Constant Value:

2
(0x00000002)


### WIDGET_CATEGORY_HOME_SCREEN

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIDGET_CATEGORY_HOME_SCREEN
```

Indicates that the widget can be displayed on the home screen. This is the default value.

<br />

Constant Value:

1
(0x00000001)


### WIDGET_CATEGORY_KEYGUARD

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIDGET_CATEGORY_KEYGUARD
```

Indicates that the widget can be displayed on the keyguard.

<br />

Constant Value:

2
(0x00000002)


### WIDGET_CATEGORY_NOT_KEYGUARD

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIDGET_CATEGORY_NOT_KEYGUARD
```

Indicates that the widget should never be shown on the keyguard.

Some keyguard style features may decide that `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_KEYGUARD` isn't
required to be added by an app to show on the feature when chosen by a user.
This category allows for a stronger statement about placement of the widget that, even in the
above case, this widget should not be offered on the keyguard.

Setting this category doesn't change the behavior of AppWidgetManager queries, it is the
responsibility of the widget surface to respect this value.

<br />

Constant Value:

8
(0x00000008)


### WIDGET_CATEGORY_SEARCHBOX

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIDGET_CATEGORY_SEARCHBOX
```

Indicates that the widget can be displayed within a space reserved for the search box.

<br />

Constant Value:

4
(0x00000004)


### WIDGET_FEATURE_CONFIGURATION_OPTIONAL

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIDGET_FEATURE_CONFIGURATION_OPTIONAL
```

The widget provides a default configuration. The host may choose not to launch the provided
configuration activity.

<br />

**See also:**

- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#widgetFeatures`

Constant Value:

4
(0x00000004)


### WIDGET_FEATURE_HIDE_FROM_PICKER

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIDGET_FEATURE_HIDE_FROM_PICKER
```

The widget is added directly by the app, and the host may hide this widget when providing
the user with the list of available widgets to choose from.

<br />

**See also:**

- `https://developer.android.com/reference/android/appwidget/AppWidgetManager#requestPinAppWidget(android.content.ComponentName,%20android.os.Bundle,%20android.app.PendingIntent)`
- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#widgetFeatures`

Constant Value:

2
(0x00000002)


### WIDGET_FEATURE_RECONFIGURABLE

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIDGET_FEATURE_RECONFIGURABLE
```

The widget can be reconfigured anytime after it is bound by starting the
`https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#configure` activity.

<br />

**See also:**

- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#widgetFeatures`

Constant Value:

1
(0x00000001)


## Fields

### CREATOR

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<AppWidgetProviderInfo> CREATOR
```

Parcelable.Creator that instantiates AppWidgetProviderInfo objects

<br />

### autoAdvanceViewId

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int autoAdvanceViewId
```

The view id of the AppWidget subview which should be auto-advanced by the widget's host.

This field corresponds to the `android:autoAdvanceViewId` attribute in
the AppWidget meta-data file.

<br />

### configure

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ComponentName configure
```

The activity to launch that will configure the AppWidget.

This class name of field corresponds to the `android:configure` attribute in
the AppWidget meta-data file. The package name always corresponds to the package containing
the AppWidget provider.

<br />

### descriptionRes

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int descriptionRes
```

Resource id for the description of the AppWidget.

This field corresponds to the `android:description` attribute in the AppWidget
meta-data file.

<br />

### generatedPreviewCategories

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int generatedPreviewCategories
```

Flags indicating the widget categories for which generated previews are available.
These correspond to the previews set by this provider with
`https://developer.android.com/reference/android/appwidget/AppWidgetManager#setWidgetPreview(android.content.ComponentName,%20int,%20android.widget.RemoteViews)`.

<br />

**See also:**

- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_HOME_SCREEN`
- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_KEYGUARD`
- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_SEARCHBOX`
- `https://developer.android.com/reference/android/appwidget/AppWidgetManager#getWidgetPreview(android.content.ComponentName,%20android.os.UserHandle,%20int)`

### icon

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int icon
```

The icon to display for this AppWidget in the AppWidget picker. If not supplied in the
xml, the application icon will be used.

This field corresponds to the `android:icon` attribute in
the `<receiver>` element in the AndroidManifest.xml file.

<br />

### initialKeyguardLayout

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int initialKeyguardLayout
```

The resource id of the initial layout for this AppWidget when it is displayed on keyguard.
This parameter only needs to be provided if the widget can be displayed on the keyguard,
see `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#widgetCategory`.

This field corresponds to the `android:initialKeyguardLayout` attribute in
the AppWidget meta-data file.

<br />

### initialLayout

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int initialLayout
```

The resource id of the initial layout for this AppWidget. This should be
displayed until the RemoteViews for the AppWidget is available.

This field corresponds to the `android:initialLayout` attribute in
the AppWidget meta-data file.

<br />

### label

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String label
```


**This field was deprecated
in API level 21.**   

Use `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#loadLabel(android.content.pm.PackageManager)`.

The label to display to the user in the AppWidget picker.

<br />

### maxResizeHeight

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int maxResizeHeight
```

Maximum height (in px) which the widget can be resized to. This field has no effect if it is
smaller than minHeight or if vertical resizing isn't enabled (see `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#resizeMode`).

This field corresponds to the `android:maxResizeHeight` attribute in the
AppWidget meta-data file.

<br />

### maxResizeWidth

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int maxResizeWidth
```

Maximum width (in px) which the widget can be resized to. This field has no effect if it is
smaller than minWidth or if horizontal resizing isn't enabled (see `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#resizeMode`).

This field corresponds to the `android:maxResizeWidth` attribute in the
AppWidget meta-data file.

<br />

### minHeight

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int minHeight
```

The default height of the widget when added to a host, in px. The widget will get
at least this height, and will often be given more, depending on the host.

This field corresponds to the `android:minHeight` attribute in
the AppWidget meta-data file.

<br />

### minResizeHeight

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int minResizeHeight
```

Minimum height (in px) which the widget can be resized to. This field has no effect if it
is greater than minHeight or if vertical resizing isn't enabled (see `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#resizeMode`).

This field corresponds to the `android:minResizeHeight` attribute in
the AppWidget meta-data file.

<br />

### minResizeWidth

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int minResizeWidth
```

Minimum width (in px) which the widget can be resized to. This field has no effect if it
is greater than minWidth or if horizontal resizing isn't enabled (see `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#resizeMode`).

This field corresponds to the `android:minResizeWidth` attribute in
the AppWidget meta-data file.

<br />

### minWidth

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int minWidth
```

The default width of the widget when added to a host, in px. The widget will get
at least this width, and will often be given more, depending on the host.

This field corresponds to the `android:minWidth` attribute in
the AppWidget meta-data file.

<br />

### previewImage

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int previewImage
```

A preview of what the AppWidget will look like after it's configured.
If not supplied, the AppWidget's icon will be used.

This field corresponds to the `android:previewImage` attribute in the AppWidget
meta-data file.

<br />

### previewLayout

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int previewLayout
```

The layout resource id of a preview of what the AppWidget will look like after it's
configured.

Unlike previewImage, previewLayout can better showcase AppWidget in different locales,
system themes, display sizes \& density etc.

If supplied, this will take precedence over the previewImage on supported widget hosts.
Otherwise, previewImage will be used.

This field corresponds to the `android:previewLayout` attribute in the
AppWidget meta-data file.

<br />

### provider

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ComponentName provider
```

Identity of this AppWidget component. This component should be a `https://developer.android.com/reference/android/content/BroadcastReceiver`, and it will be sent the AppWidget intents
`https://developer.android.com/reference/android/appwidget/package-summary`.

This field corresponds to the `android:name` attribute in
the `<receiver>` element in the AndroidManifest.xml file.

<br />

### resizeMode

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int resizeMode
```

The rules by which a widget can be resized. See `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_NONE`,
`https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_NONE`, `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_HORIZONTAL`,
`https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_VERTICAL`, `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_BOTH`.

This field corresponds to the `android:resizeMode` attribute in
the AppWidget meta-data file.


Value is either `0` or a combination of the following:

- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_HORIZONTAL`
- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#RESIZE_VERTICAL`

### targetCellHeight

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int targetCellHeight
```

The default height of a widget when added to a host, in units of launcher grid cells.

This field corresponds to the `android:targetCellHeight` attribute in the
AppWidget meta-data file.

<br />

### targetCellWidth

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int targetCellWidth
```

The default width of a widget when added to a host, in units of launcher grid cells.

This field corresponds to the `android:targetCellWidth` attribute in the
AppWidget meta-data file.

<br />

### updatePeriodMillis

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int updatePeriodMillis
```

How often, in milliseconds, that this AppWidget wants to be updated.
The AppWidget manager may place a limit on how often a AppWidget is updated.

This field corresponds to the `android:updatePeriodMillis` attribute in
the AppWidget meta-data file.

**Note:** Updates requested with `updatePeriodMillis`
will not be delivered more than once every 30 minutes.

<br />

<br />

### widgetCategory

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int widgetCategory
```

Determines whether this widget can be displayed on the home screen, the keyguard, or both.
A widget which is displayed on both needs to ensure that it follows the design guidelines
for both widget classes. This can be achieved by querying the AppWidget options in its
widget provider's update method.

This field corresponds to the `widgetCategory` attribute in
the AppWidget meta-data file.


Value is either `0` or a combination of the following:

- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_HOME_SCREEN`
- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_KEYGUARD`
- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_SEARCHBOX`
- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_CATEGORY_NOT_KEYGUARD`

### widgetFeatures

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int widgetFeatures
```

Flags indicating various features supported by the widget. These are hints to the widget
host, and do not actually change the behavior of the widget.


Value is either `0` or a combination of the following:

- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_FEATURE_RECONFIGURABLE`
- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_FEATURE_HIDE_FROM_PICKER`
- `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_FEATURE_CONFIGURATION_OPTIONAL`
**See also:**

  - `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_FEATURE_RECONFIGURABLE`
  - `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_FEATURE_HIDE_FROM_PICKER`
  - `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo#WIDGET_FEATURE_CONFIGURATION_OPTIONAL`

## Public constructors

### AppWidgetProviderInfo

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public AppWidgetProviderInfo ()
```

<br />

<br />

### AppWidgetProviderInfo

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public AppWidgetProviderInfo (Parcel in)
```

Unflatten the AppWidgetProviderInfo from a parcel.

<br />

| Parameters ||
|---|---|
| `in` | `Parcel` <br /> |

## Public methods

### clone

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public AppWidgetProviderInfo clone ()
```

Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object `x`, the expression:
>
> ```
>  x.clone() != x
> ```
will be true, and that the expression:
>
> ```
>  x.clone().getClass() == x.getClass()
> ```
will be `true`, but these are not absolute requirements. While it is typically the case that:
>
> ```
>  x.clone().equals(x)
> ```
will be `true`, this is not an absolute requirement.


By convention, the returned object should be obtained by calling
`super.clone`. If a class and all of its superclasses (except
`Object`) obey this convention, it will be the case that
`x.clone().getClass() == x.getClass()`.


By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by `super.clone` before returning it. Typically, this means
copying any mutable objects that comprise the internal "deep structure"
of the object being cloned and replacing the references to these
objects with references to the copies. If a class contains only
primitive fields or references to immutable objects, then it is usually
the case that no fields in the object returned by `super.clone`
need to be modified.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo` | a clone of this instance. <br /> |

### describeContents

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getActivityInfo

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ActivityInfo getActivityInfo ()
```

Returns the broadcast receiver that is providing this widget.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/pm/ActivityInfo` | This value cannot be `null`. <br /> |

### getProfile

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final UserHandle getProfile ()
```

Gets the user profile in which the provider resides.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/UserHandle` | The hosting user profile. <br /> |

### loadDescription

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final CharSequence loadDescription (Context context)
```

Loads localized description for the app widget.

Description is intended to be displayed in the UI of the widget picker.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: Context for accessing resources. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | CharSequence for app widget description for the current locale. This value may be `null`. <br /> |

### loadIcon

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final Drawable loadIcon (Context context, 
                int density)
```

Loads the icon to display for this AppWidget in the AppWidget picker. If not
supplied in the xml, the application icon will be used. A client can optionally
provide a desired density such as `https://developer.android.com/reference/android/util/DisplayMetrics#DENSITY_LOW`
`https://developer.android.com/reference/android/util/DisplayMetrics#DENSITY_MEDIUM`, etc. If no density is
provided, the density of the current display will be used.


The loaded icon corresponds to the `android:icon` attribute in
the `<receiver>` element in the AndroidManifest.xml file.

<br />

<br />

| Parameters ||
|---|---|
| `context` | `Context`: Context for accessing resources. This value cannot be `null`. <br /> |
| `density` | `int`: The optional desired density as per `https://developer.android.com/reference/android/util/DisplayMetrics#densityDpi`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | The provider icon. <br /> |

### loadLabel

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final String loadLabel (PackageManager packageManager)
```

Loads the localized label to display to the user in the AppWidget picker.

<br />

| Parameters ||
|---|---|
| `packageManager` | `PackageManager`: Package manager instance for loading resources. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The label for the current locale. <br /> |

### loadPreviewImage

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final Drawable loadPreviewImage (Context context, 
                int density)
```

Loads a preview of what the AppWidget will look like after it's configured.
A client can optionally provide a desired density such as
`https://developer.android.com/reference/android/util/DisplayMetrics#DENSITY_LOW`
`https://developer.android.com/reference/android/util/DisplayMetrics#DENSITY_MEDIUM`, etc. If no density is
provided, the density of the current display will be used.


The loaded image corresponds to the `android:previewImage` attribute
in the `<receiver>` element in the AndroidManifest.xml file.

<br />

<br />

| Parameters ||
|---|---|
| `context` | `Context`: Context for accessing resources. This value cannot be `null`. <br /> |
| `density` | `int`: The optional desired density as per `https://developer.android.com/reference/android/util/DisplayMetrics#densityDpi`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | The widget preview image or null if preview image is not available. <br /> |

### toString

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel out, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `out` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |