将drawable对象转换为int android

时间:2014-05-05 13:45:39

标签: android

我正在开发一个显示通知的应用。

通知包含图像,这些图像作为字节数组[]从数据库中检索并转换为位图然后可绘制[byte array [] - >位图 - > drawable - > int]

我无法将其转换为int以使用它来代替R.drawable.app_icon

Notification notification = new Notification(R.drawable.app_icon,"Today's Events", System.currentTimeMillis());

代码:

image=c.getBlob(c.getColumnIndex(BirthdayProvider.PHOTO));
        bitmapImage=BitmapFactory.decodeByteArray(image, 0, image.length);
        Drawable d=new BitmapDrawable(bitmapImage);

0 个答案:

没有答案
相关问题