Can we use VectorDrawable or VectorXML as icons for push notifications in android?

后端 未结 6 1267
故里飘歌
故里飘歌 2021-01-03 21:06

I am using PNG image but its size is getting too big so I have to compromise with its quality. So i was thinking vectors may be the another way around ? Example will be a gr

6条回答
  •  长情又很酷
    2021-01-03 21:24

    Probably you should not use VectorDrawable icons in notifications if you are using vector drawable support package - you may encounter errors on pre-lollipop devices.

    Check out this: Notification throws error when using vector drawables

    Wuthout vector drawable support package, I didn't encounter any errors but after using it, pre-lollipop devices were unable to access the vector icon at the time of notification and threw this error:

    android.app.RemoteServiceException: Bad notification posted from package com.xxx.xxx: Couldn't create icon: StatusBarIcon(pkg=com.xxx.xxxuser=0 id=0x7f020082 level=0 visible=true num=0)

提交回复
热议问题