Android Question How to set Widget select image?

hayk

Member
Hi B4X community! :)
Does anyone knows, how to set an image for the created widget to be displayed in widget select page like in attached image? Also, see the B4A widget display. How to set an image for widget?
Thanks in advance.
 

Attachments

  • widget select image.jpg
    widget select image.jpg
    92.7 KB · Views: 75
  • example.jpg
    example.jpg
    102 KB · Views: 71

hayk

Member
SOLVED!
Thanks for your reply :). Your guidance helped me a lot.
So in Objects\res\xml\widgetservice_info.xml file I've added following line:
example:
android:previewLayout="@layout/widgetreceiver_layout" android:previewImage = "@layout/preview_image"  />
where: @layout stands for file directory, widgetreceiver_layout is an widget XML file located at layout directory, previewImage is the name of JPG file witch I stored in layout folder. Stored preview image must be set Read Only otherwise compiler might delete it. Also do not write preview image file extension , only use file name as shown in code section. "previewImage" is the name of the jpeg file witch will be displayed in widget preview page.
 

Attachments

  • preview_image.jpg
    preview_image.jpg
    40.9 KB · Views: 67
  • Widget preview page.jpg
    Widget preview page.jpg
    96.9 KB · Views: 59
Last edited:
Upvote 0
Top