0

When using VectorDrawableCompat, you need to use app:srcCompat

But for RemoveViews (for custom notifications) it only works with android:src

new RemoteViews(getPackageName(), layout);

with app:srcCompat ImageViews are invisible

user924
  • 8,146
  • 7
  • 57
  • 139
  • That's because `srcCompat` is an attribute of `AppCompatImageView`. `RemoteViews` do not use `AppCompatImageView`s. For versions before Lollipop, you'll have to either create separate images and layouts for those versions, or convert and set the drawable programmatically: https://stackoverflow.com/a/35633411. – Mike M. Oct 20 '17 at 07:39
  • @MikeM. with that solution I get another error: https://stackoverflow.com/questions/35633410/appcompat-23-2-use-vectordrawablecompat-with-remoteviews-appwidget-on-api21/35633411#comment80637561_35633411 – user924 Oct 20 '17 at 08:26
  • @MikeM. seems a bug, added annotation: https://stackoverflow.com/a/44926919/7767664 – user924 Oct 20 '17 at 08:28
  • Ah, yep, looks like they restricted that class relatively recently. – Mike M. Oct 20 '17 at 08:32

0 Answers0