In my application, I have to set a large icon for a notification.
LargeIcon must be a Bitmap, and my drawables are vector images (the new feature in Android, see this link)
The problem is when I try to decode a resource that is a vector image, I get a null returned.
Here is the sample of code :
if (BitmapFactory.decodeResource(arg0.getResources(), R.drawable.vector_menu_objectifs) == null)
Log.d("ISNULL", "NULL");
else
Log.d("ISNULL", "NOT NULL");
In this sample, when I replace R.drawable.vector_menu_objectifs with a "normal" image, a png for exemple, the result is not null (I get the correct bitmap)
Is there something I'm missing?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…