Android应用中怎么实现通知栏闪动效果-创新互联

Android应用中怎么实现通知栏闪动效果?相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。

成都创新互联专注于宁国网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供宁国营销型网站建设,宁国网站制作、宁国网页设计、宁国网站官网定制、微信小程序定制开发服务,打造宁国网络公司原创品牌,更为您提供宁国网站排名全网营销落地服务。

显示通知代码:

private void showNotification(Context ctx, String url) {
    Notification n = new Notification();
    n.flags |= Notification.FLAG_SHOW_LIGHTS;
    n.flags |= Notification.FLAG_AUTO_CANCEL;
    n.defaults = Notification.DEFAULT_SOUND;
    n.icon = R.drawable.ic_launcher;
    n.when = System.currentTimeMillis();
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setClassName(ctx.getPackageName(), MainActivity.class.getName());
    PendingIntent pi = PendingIntent.getActivity(ctx, 0, intent, 0);
    n.setLatestEventInfo(ctx, "title", "summary", pi);
    NotificationManager manager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE);
    manager.notify(0, n);
}

文章标题:Android应用中怎么实现通知栏闪动效果-创新互联
网站链接:http://bzwzjz.com/article/dsohpo.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 网站设计公司 成都网站建设 app网站建设 定制网站建设 成都营销网站制作 品牌网站建设 成都网站制作 成都定制网站建设 成都网站设计 成都网站设计制作公司 重庆网站设计 四川成都网站建设 重庆外贸网站建设 成都响应式网站建设公司 网站制作 外贸网站设计方案 成都网站建设公司 盐亭网站设计 网站建设方案 成都网站建设 成都品牌网站建设 网站制作公司