public class

AppWidgetProviderInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.appwidget.AppWidgetProviderInfo

Class Overview

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 RESIZE_BOTH Widget is resizable in both the horizontal and vertical axes.
int RESIZE_HORIZONTAL Widget is resizable in the horizontal axis only.
int RESIZE_NONE Widget is not resizable.
int RESIZE_VERTICAL Widget is resizable in the vertical axis only.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<AppWidgetProviderInfo> CREATOR Parcelable.Creator that instantiates AppWidgetProviderInfo objects
public int autoAdvanceViewId The view id of the AppWidget subview which should be auto-advanced by the widget's host.
public ComponentName configure The activity to launch that will configure the AppWidget.
public int icon The icon to display for this AppWidget in the AppWidget picker.
public int initialLayout The resource id of the initial layout for this AppWidget.
public String label The label to display to the user in the AppWidget picker.
public int minHeight The default height of the widget when added to a host, in dp.
public int minResizeHeight Minimum height (in dp) which the widget can be resized to.
public int minResizeWidth Minimum width (in dp) which the widget can be resized to.
public int minWidth The default height of the widget when added to a host, in dp.
public int previewImage A preview of what the AppWidget will look like after it's configured.
public ComponentName provider Identity of this AppWidget component.
public int resizeMode The rules by which a widget can be resized.
public int updatePeriodMillis How often, in milliseconds, that this AppWidget wants to be updated.
Public Constructors
AppWidgetProviderInfo()
AppWidgetProviderInfo(Parcel in)
Unflatten the AppWidgetProviderInfo from a parcel.
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel out, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int RESIZE_BOTH

Since: API Level 12

Widget is resizable in both the horizontal and vertical axes.

Constant Value: 3 (0x00000003)

public static final int RESIZE_HORIZONTAL

Since: API Level 12

Widget is resizable in the horizontal axis only.

Constant Value: 1 (0x00000001)

public static final int RESIZE_NONE

Since: API Level 12

Widget is not resizable.

Constant Value: 0 (0x00000000)

public static final int RESIZE_VERTICAL

Since: API Level 12

Widget is resizable in the vertical axis only.

Constant Value: 2 (0x00000002)

Fields

public static final Creator<AppWidgetProviderInfo> CREATOR

Since: API Level 3

Parcelable.Creator that instantiates AppWidgetProviderInfo objects

public int autoAdvanceViewId

Since: API Level 11

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.

public ComponentName configure

Since: API Level 3

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.

public int icon

Since: API Level 3

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.

public int initialLayout

Since: API Level 3

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.

public String label

Since: API Level 3

The label to display to the user in the AppWidget picker. If not supplied in the xml, the application label will be used.

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

public int minHeight

Since: API Level 3

The default height of the widget when added to a host, in dp. 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.

public int minResizeHeight

Since: API Level 14

Minimum height (in dp) 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 resizeMode).

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

public int minResizeWidth

Since: API Level 14

Minimum width (in dp) 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 resizeMode).

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

public int minWidth

Since: API Level 3

The default height of the widget when added to a host, in dp. 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.

public int previewImage

Since: API Level 11

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 <receiver> element in the AndroidManifest.xml file.

public ComponentName provider

Since: API Level 3

Identity of this AppWidget component. This component should be a BroadcastReceiver, and it will be sent the AppWidget intents as described in the AppWidget package documentation.

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

public int resizeMode

Since: API Level 12

The rules by which a widget can be resized. See RESIZE_NONE, RESIZE_NONE, RESIZE_HORIZONTAL, RESIZE_VERTICAL, RESIZE_BOTH.

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

public int updatePeriodMillis

Since: API Level 3

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.

Public Constructors

public AppWidgetProviderInfo ()

Since: API Level 3

public AppWidgetProviderInfo (Parcel in)

Since: API Level 3

Unflatten the AppWidgetProviderInfo from a parcel.

Public Methods

public int describeContents ()

Since: API Level 3

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public String toString ()

Since: API Level 3

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel out, int flags)

Since: API Level 3

Flatten this object in to a Parcel.

Parameters
out The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.