Activity 通知

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);
Activity 通知

Activity 通知

上一篇:cookie存取数据分析


下一篇:C# 操作word