AppWidgetProviderInfo.LoadIcon(Context, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Loads the icon to display for this AppWidget in the AppWidget picker.
[Android.Runtime.Register("loadIcon", "(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;", "")]
public Android.Graphics.Drawables.Drawable? LoadIcon (Android.Content.Context context, int density);
[<Android.Runtime.Register("loadIcon", "(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;", "")>]
member this.LoadIcon : Android.Content.Context * int -> Android.Graphics.Drawables.Drawable
Parameters
- context
- Context
Context for accessing resources.
- density
- Int32
The optional desired density as per
android.util.DisplayMetrics#densityDpi
.
Returns
The provider icon.
- Attributes
Remarks
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 android.util.DisplayMetrics#DENSITY_LOW
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.
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.