public void notifyKJ() {
//获得通知管理器,通知是一项系统服务
NotificationManager manager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);
//初始化通知对象 p1:通知的图标 p2:通知的状态栏显示的提示 p3:通知显示的时间
Notification notification = new Notification(R.drawable.kjalarm, "提醒", System.currentTimeMillis());
//点击通知后的Intent,此例子点击后还是在当前界面
Intent descIntent = new Intent(context, com.acp.main.DesktopUI.class);
descIntent.putExtra(DesktopUI.requestCode,DesktopUI.KJ);
PendingIntent intent = PendingIntent.getActivity(context, 0, descIntent, 0);
//设置通知信息
notification.setLatestEventInfo(context, "提醒", "祝您天天快乐", intent);
notification.flags|=Notification.FLAG_AUTO_CANCEL; //当查看后,自动消失
notification.defaults |= Notification.DEFAULT_SOUND;//默认声音提示
//通知
manager.notify(NOTICE_ID, notification);
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有