Android消息推送接收后,通知栏的显示
来源:互联网 发布:完美软件视频 编辑:程序博客网 时间:2024/05/21 11:13
消息推送接收到后,显示通知栏
public static void showNotifictionIcon(Context context) { NotificationCompat.Builder builder = new NotificationCompat.Builder(context); Intent intent = new Intent(context, XXXActivity.class);//将要跳转的界面 //Intent intent = new Intent();//只显示通知,无页面跳转 builder.setAutoCancel(true);//点击后消失 builder.setSmallIcon(R.drawable.app_icon);//设置通知栏消息标题的头像 builder.setDefaults(NotificationCompat.DEFAULT_SOUND);//设置通知铃声 builder.setTicker("状态栏显示的文字"); builder.setContentTitle("标题"); builder.setContentText("通知内容"); //利用PendingIntent来包装我们的intent对象,使其延迟跳转 PendingIntent intentPend = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); builder.setContentIntent(intentPend); NotificationManager manager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE); manager.notify(0, builder.build()); }
阅读全文
0 0
- Android消息推送接收后,通知栏的显示
- android 消息推送,手机被动接收类似通知的短消息
- Android 通知栏推送消息
- Android消息推送通知的原理:
- Android接收RabbitMQ推送过来的消息
- Android显示通知栏消息
- Android 消息推送通知指南
- Android推送通知消息管理
- SignalR+HTML5实现消息推送及Android通知栏消息
- Android 上的消息推送通知(Push Notification)
- Android客户端接收来自Faye的消息推送
- android(SignalA)接收.net(SignalR)推送过来的消息
- 【Android】当关闭通知消息权限后无法显示系统Toast的解决方案
- Android中当用户关闭通知消息权限后Toast显示不出的问题
- 【Android】当关闭通知消息权限后无法显示系统Toast的解决方案
- 极光推送 接收到推送消息后处理方法
- android通知栏的消息通知(Notification)
- 关于android语言切换后通知栏显示的问题
- UUML和绘图工具Visio介绍
- 蓝桥杯ALGO-91Anagrams问题
- Tomcat不够轻量?那就自己写一个服务器呗(Netty-demo)
- Android Studio的.gitignore以及gitignore无效的解决
- 上传头像(拍照或者本地上传)
- Android消息推送接收后,通知栏的显示
- python语言
- angular视频教程,需要的可以看看
- JVM系列五:JVM监测&工具
- python基础-linux下ipython
- PHP常见的设计模式之:注册树模式
- 修改数据库控制文件多路径启库时出现ORA-00214
- Codeforces Round #453 (Div. 2) A,B
- 大公司已经开始开始探索量子计算的应用模式,量子计算离我们还有多远?