次の方法で共有


AppWidgetManager.SetWidgetPreview Method

Definition

Set a preview for this widget.

[Android.Runtime.Register("setWidgetPreview", "(Landroid/content/ComponentName;ILandroid/widget/RemoteViews;)Z", "GetSetWidgetPreview_Landroid_content_ComponentName_ILandroid_widget_RemoteViews_Handler", ApiSince=35)]
public virtual bool SetWidgetPreview (Android.Content.ComponentName provider, Android.Appwidget.AppWidgetCategory widgetCategories, Android.Widget.RemoteViews preview);
[<Android.Runtime.Register("setWidgetPreview", "(Landroid/content/ComponentName;ILandroid/widget/RemoteViews;)Z", "GetSetWidgetPreview_Landroid_content_ComponentName_ILandroid_widget_RemoteViews_Handler", ApiSince=35)>]
abstract member SetWidgetPreview : Android.Content.ComponentName * Android.Appwidget.AppWidgetCategory * Android.Widget.RemoteViews -> bool
override this.SetWidgetPreview : Android.Content.ComponentName * Android.Appwidget.AppWidgetCategory * Android.Widget.RemoteViews -> bool

Parameters

provider
ComponentName

The ComponentName for the android.content.BroadcastReceiver BroadcastReceiver provider for the AppWidget you intend to provide a preview for.

widgetCategories
AppWidgetCategory

The categories that this preview should be used for. This can be a single category or combination of categories. If multiple categories are specified, then this preview will be used for each of those categories. For example, if you set a preview for WIDGET_CATEGORY_HOME_SCREEN | WIDGET_CATEGORY_KEYGUARD, the preview will be used when picking widgets for the home screen and keyguard.

           &lt;p&gt;Note: You should only use the widget categories that the provider supports, as defined
           in <code data-dev-comment-type="c">AppWidgetProviderInfo#widgetCategory</code>.
preview
RemoteViews

This preview will be used for previewing the provider when picking widgets for the selected categories.

Returns

true if the call was successful, false if it was rate-limited.

Attributes

Remarks

Set a preview for this widget. This preview will be used instead of the provider's AppWidgetProviderInfo#previewLayout previewLayout or AppWidgetProviderInfo#previewImage previewImage for previewing the widget in the widget picker and pin app widget flow.

Java documentation for android.appwidget.AppWidgetManager.setWidgetPreview(android.content.ComponentName, int, android.widget.RemoteViews).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to