How can I change the image displayed in the Android widget selection dialog?

How do I change the rendering?

enter image description here

+4


source to share


2 answers


Specify the attributeandroid:previewImage

in the app widget 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 )

+6


source


I got the same problem, tried everything, uninstalled the old previewImage, uninstalled / reinstalled the app, rebooted the device, synced the project with Gradle files, Invalidate Caches / Restart, nothing worked. Finally, I could only change it after changing the applicationId in the application build.gradle file .



0


source







All Articles