NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); // Notification Notification notification = new Notification(); notification.icon = R.drawable.ic_launcher; // 设置通知的图标 notification.defaults |= Notification.DEFAULT_SOUND; // notification.defaults |= Notification.DEFAULT_VIBRATE; notification.flags |= Notification.FLAG_AUTO_CANCEL; notification.when = System.currentTimeMillis(); Intent intent = new Intent(context, MainActivity.class); // intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); // intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); // intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); // intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); // notification.setLatestEventInfo(context, "有新消息", message.getContent(), contentIntent); notificationManager.notify(message.getTime().hashCode(), notification);
相关推荐
android 2.3 源代码 android 2.3 源代码 android 2.3 源代码
android2.3 launcher分析三
flash for android2.3
android 2.3升级方法 android 2.3升级方法 android 2.3升级方法 android 2.3升级方法
android2.3源码-binder机制.doc 对binder机制的详细分析
android源码解读—stagefright框架 对android2.3源码stagefright框架 的详细解读
Ubuntu平台下Android2.3源码下载编译全过程
Android 2.3 r1开发者指南——AIDL
android 2.3 sdk android-2.3-sdk android 2.3 sdk android-2.3-sdk
Android2.3应用开发实战,林城著,源代码
书中完整介绍了 android2.3版的功能,相关范例程序所涉及的主题范围广泛,且有清楚的解说。 《android 2.3应用开发实战》包括 android介绍、开发环境、应用开发平台、活动程序 activity、意图方法intent、widget、...
Android2.3通过蓝牙串口接收数据,并解析。
android2.3下三星6410串口开发总结,uboot裸机代码,android下jin层串口初始化、读、写函数
flash10.2 经测试在android2.3上面很稳定,能够通过android自带浏览器访问网页上的flash 使用方法: 1.adb安装 adb install 文件名称 2.放置到sdcard目录,通过文件浏览器安装 文件浏览器apk另见我的下载资源中
Android 2.3截屏JNI代码 Android 2.3截屏JNI代码 Android 2.3截屏JNI代码
支持Android2.3 版本以下使用的Root Explorer
Android4.0 与 android2.3 差异
android2.3源码android2.3源码android2.3源码android2.3源码android2.3源码android2.3源码android2.3源码android2.3源码android2.3源码android2.3源码android2.3源码android2.3源码
android 2.3源码android 2.3源码android 2.3源码android 2.3源码android 2.3源码android 2.3源码android 2.3源码android 2.3源码
android2.3 launcher分析