大佬教程收集整理的这篇文章主要介绍了android – 通知栏显示大图标和小图标,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
if (Build.VERSION.SDK_INT > 10){ notification = new Notification(R.drawable.ic_stat_mintchip,"This is a test",System.currentTimeMillis()); notification.largeIcon = (((BitmapDrawablE)c.getresources().getDrawable(R.drawable.ic_launcher)).getBitmap()); notification.defaults |= Notification.DEFAULT_ALL; notification.number += 1; notification.flags |= Notification.FLAG_AUTO_CANCEL; } else { notification = new Notification(R.drawable.ic_stat_mintchip,System.currentTimeMillis()); notification.flags |= Notification.FLAG_AUTO_CANCEL; notification.defaults |= Notification.DEFAULT_ALL; notification.number += 1; } }
我不太清楚为什么会这样.任何帮助?
Notification.builder nb = new Notification.builder(context) .setContenttitle("title") .setContentText("content") .setAutoCancel(true) .setLargeIcon(largeIcon) .setsmallIcon(R.drawable.small_icon) .setTicker(s.getText()); notificationmanager nm = (notificationmanager)context.getSystemservice(Context.NOTIFICATION_serviCE); nm.notify(100,nb.build());
以上是大佬教程为你收集整理的android – 通知栏显示大图标和小图标全部内容,希望文章能够帮你解决android – 通知栏显示大图标和小图标所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。