AppWidget image with rounded corners

前端 未结 2 1534
遥遥无期
遥遥无期 2021-01-26 18:02

So, I am dynamically creating an image within my app by animating various Views that I display to the user in the main layout of my application.

Currently I am generati

2条回答
  •  日久生厌
    2021-01-26 18:52

    Sadly, AppWidgets are quite limited in terms of views. you can only use the views that Android supports.

    The reason is that the code of the view needs to run on the container of the AppWidget, and that's a security risk, since you could get a glimpse at the private data of the app that shows it. So what Google did is that you need to prepare what to show, and when you finished, tell a restricted API how to show the AppWidget.

    So the solution would be to flush the image as it should be shown , to an imageView or something similar. I suggest to do it in the background if it has a lot to prepare.

    It all depends on your needs.

提交回复
热议问题