zoukankan      html  css  js  c++  java
  • Activity 通知

            //通知图标
            int icon = android.R.drawable.stat_notify_chat;
            //创建通知对象,icon通知图标,tickerText摘要,System.currentTimeMillis()通知时间
            Notification notification = new Notification(icon, tickerText, System.currentTimeMillis());
            Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:194949494"));
            //点击通知时的处理方法
            PendingIntent pendingIntent = PendingIntent.getActivity(this, 10, intent, 0);
            //为通知设置各项内容
            notification.setLatestEventInfo(this, title, content, pendingIntent);
            //设置通知的声音
            notification.defaults = Notification.DEFAULT_SOUND;
            //设置查看通知后,通知图标自动取消
            notification.flags = Notification.FLAG_AUTO_CANCEL;
            //构建通知管理器
            NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
            //发送通知
            manager.notify(100, notification);
  • 相关阅读:
    Jenkins 搭建篇
    gitlab搭建使用
    apiDoc部署搭建
    传统切图
    Web前端性能优化的9大问题
    photoshop cc 智能切图
    ps切图
    前端ps切图,图文教程,详细。
    axios
    数组API
  • 原文地址:https://www.cnblogs.com/heml/p/3517382.html
Copyright © 2011-2022 走看看