android 通知栏的Intent事件
来源:互联网 发布:汽车零部件进出口数据 编辑:程序博客网 时间:2024/06/03 20:04
//获取管理器
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder builder = new NotificationCompat.Builder(context);builder.setSmallIcon(R.mipmap.ic_launcher).setContentTitle(title).setContentText(msg);if (intent != null) { builder.setContentIntent(PendingIntent.getActivity(context, id, intent, 0)); Log.e("233", "showNotification: " + intent.getIntExtra("action", 10086));}manager.notify(id, builder.build());这样就可以显示一个最简单的通知栏PendingIntent.getActivity(context, id, intent, 0)中id的那个是requestCode 请求代码。这个不写重复的,否侧之后你的Intent中带的参数将会无法传递至你跳转的Activity中。
阅读全文
0 0
- android 通知栏的Intent事件
- android 发送通知栏通知的灵异事件
- android通知栏响应事件
- Android通知栏点击事件
- Android intent消息通知机制
- Android拨打电话的intent事件
- Android自定义通知栏及响应通知栏事件
- 【Android】监听自定义通知栏消息事件
- Intent 通知的Flag定义
- android开发之Intent.setFlags()_让Android点击通知栏信息后返回正在运行的程序
- android开发之Intent.setFlags()_让Android点击通知栏信息后返回正在运行的程序
- android通知栏通知的开发笔记
- android通知栏的消息通知(Notification)
- 点击通知栏中推送通知的触发事件
- android DownloadManager广播事件:下载完成、通知栏点击事件
- 通知栏点击通知后,Intent开启activity产生的问题
- Android通知栏通知
- Android 广播 Intent Action 事件
- Linux的cat命令详解
- POJ 3041 Asteroids 匈牙利算法
- IE和DOM事件流的区别
- [Leetcode] 158. Read N Characters Given Read4 II
- C++数组指针
- android 通知栏的Intent事件
- 用友U8获取指定用户在某个账套中是否拥有指定权限
- java做网站
- LeetCode 561. Array Partition I
- 【数组模拟链表】UVA
- Spring线程池和自定义线程池的使用
- 06-图1 列出连通集 (25分) C++
- 2017.5.27入门组总结
- 【剑指offer-解题系列(32)】整数区间中出现1的个数