app widget setImageViewUri does not update the image

后端 未结 3 1092
情深已故
情深已故 2020-12-17 17:52

i have an app widget, which contains only one imageview. i redraw that image and store it as png in apps\'s private memory and then i set the RemoteViews\' image with the ur

3条回答
  •  误落风尘
    2020-12-17 18:35

    If the Uri remains unchanged, it seems Android won't update the image. I've found a bit of a hack to get around this though. Just call widget.setImageViewUri(R.id.widget_icon, Uri.parse("")); before widget.setImageViewUri(R.id.widget_icon, uri);.

    It calls setImageViewUri() twice, but seems to be working OK. I'd love to hear a better way to fix it though, as I'm experiencing this issue myself.

提交回复
热议问题