问题
How do I change the rendering?
回答1:
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)
回答2:
I had the same issue, tried everything deleted the old previewImage, uninstall/reinstall app, rebooting device, Sync Project with Gradle Files, Invalidate Caches/Restart, none worked. Finally, I could change it only after changing applicationId in build.gradle app file.
来源:https://stackoverflow.com/questions/27650435/how-to-change-the-image-displayed-in-the-android-widget-selection-dialogue