为什么需要NotificationCompat? [英] Why is NotificationCompat needed?

查看:72
本文介绍了为什么需要NotificationCompat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具体地说,我认为使用NotificationCompat完成的任何操作都可以使用默认API(级别8)完成。
我在这里想念什么?

Specifically, I think anything done with NotificationCompat can be done using the default API (level 8). What am I missing here? What does NotificationCompat introduce that cannot be done using 2.2 API?

资料来源: http://developer.android.com/sdk/compatibility-library.html#Notes

推荐答案

您可以使用NotificationCompat.Builder#setLargeIcon(Bitmap)之类的东西,使您可以充分利用Android 3.0+的大图标等功能,同时保持与3.0之前的Android版本的兼容性不支持这种事情。

You can use things like NotificationCompat.Builder#setLargeIcon(Bitmap) to allow you to take full advantage of Android 3.0+ with things like the large icon, while maintaining compatibility on versions of Android prior to 3.0 that do not support such things.

这篇关于为什么需要NotificationCompat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆