2.0 使用库实现类似的方法(向下兼容2.3)
=======================
下面介绍一个自己写的,类似 Heads-up 组件的库.
simple heads-up (no expand)
使用方法:
HeadsUpManager manage = HeadsUpManager.getInstant(getApplication());
HeadsUp.Builder builder = new HeadsUp.Builder(MainActivity.this);
builder.setContentTitle(“提醒”).setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS)
//要显示通知栏通知,这个一定要设置
.setSmallIcon(R.drawable.icon)
//2.3 一定要设置这个参数,否则会报错
.setContentIntent(pendingIntent)
.setContentText(“你有新的消息”);
HeadsUp headsUp = builder.buildHeadUp();
manage.notify(code++, headsUp);
simple heads-up
使用方法:
HeadsUpManager manage = HeadsUpManager.getInstant(getApplication());
HeadsUp.Builder builder = new HeadsUp.Bui