Added in API level 3

AppWidgetProviderInfo


open class AppWidgetProviderInfo : Parcelable
kotlin.Any
   ↳ android.appwidget.AppWidgetProviderInfo

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
static Int

Widget is resizable in both the horizontal and vertical axes.

static Int

Widget is resizable in the horizontal axis only.

static Int

Widget is not resizable.

static Int

Widget is resizable in the vertical axis only.

static Int

Indicates that the widget can be displayed on the home screen.

static Int

Indicates that the widget can be displayed on the keyguard.

static Int

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

static Int

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

static Int

The widget provides a default configuration.

static Int

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.

static Int

The widget can be reconfigured anytime after it is bound by starting the configure activity.

Inherited constants
Public constructors

Unflatten the AppWidgetProviderInfo from a parcel.

Public methods
open AppWidgetProviderInfo!

Creates and returns a copy of this object.

open Int

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

open ActivityInfo

Returns the broadcast receiver that is providing this widget.

UserHandle!

Gets the user profile in which the provider resides.

CharSequence?

Loads localized description for the app widget.

Drawable!
loadIcon(context: Context, density: Int)

Loads the icon to display for this AppWidget in the AppWidget picker.

String!
loadLabel(packageManager: PackageManager!)

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

Drawable!
loadPreviewImage(context: Context, density: Int)

Loads a preview of what the AppWidget will look like after it's configured.

open String

Returns a string representation of the object.

open Unit
writeToParcel(out: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<AppWidgetProviderInfo!>

Parcelable.

Int

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

ComponentName!

The activity to launch that will configure the AppWidget.

Int

Resource id for the description of the AppWidget.

Int

Flags indicating the widget categories for which generated previews are available.

Int

The icon to display for this AppWidget in the AppWidget picker.

Int

The resource id of the initial layout for this AppWidget when it is displayed on keyguard.

Int

The resource id of the initial layout for this AppWidget.

String!

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

Int

Maximum height (in px) which the widget can be resized to.

Int

Maximum width (in px) which the widget can be resized to.

Int

The default height of the widget when added to a host, in px.

Int

Minimum height (in px) which the widget can be resized to.

Int

Minimum width (in px) which the widget can be resized to.

Int

The default width of the widget when added to a host, in px.

Int

A preview of what the AppWidget will look like after it's configured.

Int

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

ComponentName!

Identity of this AppWidget component.

Int

The rules by which a widget can be resized.

Int

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

Int

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

Int

How often, in milliseconds, that this AppWidget wants to be updated.

Int

Determines whether this widget can be displayed on the home screen, the keyguard, or both.

Int

Flags indicating various features supported by the widget.

Constants

RESIZE_BOTH

Added in API level 12
static val RESIZE_BOTH: Int

Widget is resizable in both the horizontal and vertical axes.

Value: 3

RESIZE_HORIZONTAL

Added in API level 12
static val RESIZE_HORIZONTAL: Int

Widget is resizable in the horizontal axis only.

Value: 1

RESIZE_NONE

Added in API level 12
static val RESIZE_NONE: Int

Widget is not resizable.

Value: 0

RESIZE_VERTICAL

Added in API level 12
static val RESIZE_VERTICAL: Int

Widget is resizable in the vertical axis only.

Value: 2

WIDGET_CATEGORY_HOME_SCREEN

Added in API level 17
static val WIDGET_CATEGORY_HOME_SCREEN: Int

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

Value: 1

WIDGET_CATEGORY_KEYGUARD

Added in API level 17
static val WIDGET_CATEGORY_KEYGUARD: Int

Indicates that the widget can be displayed on the keyguard.

Value: 2

WIDGET_CATEGORY_NOT_KEYGUARD

Added in API level 36
static val WIDGET_CATEGORY_NOT_KEYGUARD: Int

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

Some keyguard style features may decide that 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.

Value: 8
Added in API level 21
static val WIDGET_CATEGORY_SEARCHBOX: Int

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

Value: 4

WIDGET_FEATURE_CONFIGURATION_OPTIONAL

Added in API level 31
static val WIDGET_FEATURE_CONFIGURATION_OPTIONAL: Int

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

Value: 4

See Also

WIDGET_FEATURE_HIDE_FROM_PICKER

Added in API level 28
static val WIDGET_FEATURE_HIDE_FROM_PICKER: Int

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.

Value: 2

WIDGET_FEATURE_RECONFIGURABLE

Added in API level 28
static val WIDGET_FEATURE_RECONFIGURABLE: Int

The widget can be reconfigured anytime after it is bound by starting the configure activity.

Value: 1

See Also

Public constructors

AppWidgetProviderInfo

Added in API level 3
AppWidgetProviderInfo()

AppWidgetProviderInfo

Added in API level 3
AppWidgetProviderInfo(in: Parcel!)

Unflatten the AppWidgetProviderInfo from a parcel.

Public methods

clone

Added in API level 3
open fun clone(): AppWidgetProviderInfo!

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.

Return
AppWidgetProviderInfo! a clone of this instance.
Exceptions
java.lang.CloneNotSupportedException if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

describeContents

Added in API level 3
open fun describeContents(): Int

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 writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getActivityInfo

Added in API level 31
open fun getActivityInfo(): ActivityInfo

Returns the broadcast receiver that is providing this widget.

Return
ActivityInfo This value cannot be null.

getProfile

Added in API level 21
fun getProfile():