重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

Notification-创新互联

1.android3.0版本以上的用法:

目前累计服务客户近1000家,积累了丰富的产品开发及服务经验。以网站设计水平和技术实力,树立企业形象,为客户提供做网站、网站制作、网站策划、网页设计、网络营销、VI设计、网站改版、漏洞修补等服务。成都创新互联始终以务实、诚信为根本,不断创新和提高建站品质,通过对领先技术的掌握、对创意设计的研究、对客户形象的视觉传递、对应用系统的结合,为客户提供更好的一站式互联网解决方案,携手广大客户,共同发展进步。

NotificationManager nm = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
    Notification.Builder nb=new Builder(DownLoadService.this);
    Intent intent=new Intent();
    intent.setAction(Intent.ACTION_CALL);
    intent.setData(Uri.parse("tel:110"));
    PendingIntent pendingIntent=PendingIntent.getActivity(DownLoadService.this, 0, intent, 0);
    nb.setContentTitle("标题");
    nb.setContentText("内容");
    nb.setSmallIcon(R.drawable.alert_dark_frame);
    nb.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.alert_dark_frame));
    nb.setContentIntent(pendingIntent);
    Notification notification=nb.build();
    notification.flags= Notification.FLAG_AUTO_CANCEL;
    nm.notify(0, notification);

2.android任何版本通用用法:

NotificationManager nm=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
    Notification notification=new Notification(R.drawable.alert_dark_frame,"",System.currentTimeMillis());
    notification.flags= Notification.FLAG_AUTO_CANCEL;
    Intent intent=new Intent();
    intent.setAction(Intent.ACTION_CALL);
    intent.setData(Uri.parse("tel:110"));
    PendingIntent pendingIntent=PendingIntent.getActivity(this, 0, intent, 0);
    notification.setLatestEventInfo(this, "标题", "内容", pendingIntent);
    nm.notify(0, notification);

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


本文题目:Notification-创新互联
链接地址:http://cqcxhl.com/article/djieso.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP