Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the image displayed in the android widget selection dialogue?

Tags:

android

widget

How do I change the rendering?

enter image description here

like image 658
user3552325 Avatar asked Mar 17 '23 12:03

user3552325


1 Answers

Specify the android:previewImage attribute in your app widget XML metadata file:

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
  android:minWidth="146dip"
  android:minHeight="146dip"
  android:updatePeriodMillis="0"
  android:initialLayout="@layout/widget"
  android:autoAdvanceViewId="@+id/words"
  android:previewImage="@drawable/preview"
  android:resizeMode="vertical"
/>

(from this sample project)

like image 137
CommonsWare Avatar answered Apr 06 '23 00:04

CommonsWare