0
A
回答
1
在这里,他们是
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
private void notification(String message){
int icon = R.drawable.ic_launcher;
CharSequence ticket = message;
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, ticket, when);
notification.flags |= Notification.FLAG_AUTO_CANCEL;
CharSequence contentTitle = "Buzz Off";
CharSequence contentText = message;
Intent intent = new Intent(this, HomeScreen.class);
PendingIntent activity = PendingIntent.getActivity(this, 0, intent, 0);
notification.setLatestEventInfo(this, contentTitle, contentText, activity);
nm.notify(layout, notification);
buzzOff = true;
}
相关问题
- 1. Android - 增量状态栏通知图标
- 2. Android状态栏通知
- 3. Phonegap - Android - 状态栏通知
- 4. 状态栏上的通知栏上的事件android
- 5. Android如何在状态栏上隐藏NotificationCompat.Builder通知的图标?
- 6. Android状态栏通知 - 通过任何方式通知状态栏(烤面包)通过状态栏?
- 7. Android:静态状态栏通知
- 8. 状态栏通知
- 9. 状态栏通知
- 10. 如何在Android手机状态栏上添加通知图标?
- 11. PhoneGap的Android状态栏通知例如
- 12. 状态栏android中的通知
- 13. PhoneGap的状态栏通知
- 14. Phonegap状态栏通知,Android,iOS
- 15. 每天更改android状态栏通知
- 16. Android状态栏multiline通知API 14
- 17. android状态栏没有通知弹出
- 18. Android如何拦截状态栏通知?
- 19. Android状态栏通知不加载
- 20. Android mipmap图标作为状态(通知)栏图标
- 21. 状态栏上显示单行通知?
- 22. 状态栏中的Android 5(棒棒糖)中的显示徽标
- 23. 通知状态栏文本
- 24. 状态栏旋转通知
- 25. 处理状态栏通知
- 26. 多个状态栏通知
- 27. Android的亮度变化通知(或状态栏汇总通知)
- 28. 多个通知与android中的一个状态栏图标
- 29. 状态栏和主要通知的单独通知图标
- 30. parse.com - 从android上的状态栏中删除特定的通知
看到这使后:: http://stackoverflow.com/questions/3712758/controlling-the-android-status-bar-icon – Eight
@ abhinav8,谢谢,这个问题似乎是相似的,但没有接受的答案,也没有提示代码示例。但也会找那个帖子。 – azizbekian
我将你的问题标题复制到谷歌,我得到的第一个打击是[官方文档](http://developer.android.com/guide/topics/ui/notifiers/notifications.html)。它用示例解释了与通知有关的所有信息,包括这些。所以下次再搜索一下,在这种情况下会节省半个小时。 – 2012-06-03 08:34:20