Hello, tell me, is it possible to use vector images in desktop widgets? The simplest layout for an imageview widget with an app: srcCompat simply does not display an image; with android: src image is displayed.
1 answer
Now I stumbled upon an answer, they removed support for vector images in the AppCompat support library in version 23.3, due to some kind of error. In version 23.4, support for vector images has been restored. Now the newest version is 24.2.1 and in it vector images have earned only when I changed the usual ImageView on AppCompatImageView. And earned only in Activity, the widget is still getting enough sleep with an error.
UPD: finally found a way. Still, if you set the image in the xml markup for the widget, then it is not shown in the widget. But if you set it programmatically, then everything works like a clock, like this:
RemoteViews widgetViews = new RemoteViews(ctx.getPackageName(), R.layout.widget); widgetViews.setImageViewResource(R.id.imageView, R.drawable.vectorImage); UPD: setImageViewResource works for older versions, on 4.3.1 Android is still a problem