草庐IT

通知栏

全部标签

Java Android - Redmi 3 (MIUI) - 无法更改通知图标?

我正在尝试更改通知图标,并且在模拟器中没问题:这就是我想要的(在模拟器API级别22(android5.1.1)上测试)但是,当我在我的真实手机(带有MIUI8.0.1的小米Redmi3prime)以及android5.1中运行此应用程序时。1-通知看起来非常非常不同。此通知图标不显示(只是默认应用程序图标)。但是……为什么?我现在可以做什么?这是我的代码:NotificationCompat.Builderb=newNotificationCompat.Builder(compat);b.setSmallIcon((state==STATE_STOPPED)?R.drawable.i

android - 更新通知区的进度条

关于如何在通知栏中制作自定义布局,已经有多个主题。问题是我一定遗漏了一些简单的东西。我有一个custom_notification_layout.xml我还有一些创建通知的测试代码,它可以工作并显示进度条。NotificationManagermManager=(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);Notificationnotification=newNotification(R.drawable.icon,title,System.currentTimeMillis()

安卓取消通知

我有一个正在运行的后台服务来获取数据。我检查新数据并发送状态栏通知。发送通知是服务的一部分。当用户看到该通知时,他登录到应用程序并接受它。那一次我想从状态栏中删除它。我可以这样做吗? 最佳答案 if(Context.NOTIFICATION_SERVICE!=null){Stringns=Context.NOTIFICATION_SERVICE;NotificationManagernMgr=(NotificationManager)getApplicationContext().getSystemService(ns);nMgr.

android - React-Native- 未能通知项目评估监听器

使用gradle4.3在Windows7上构建一个react-native应用程序,我收到以下错误,不确定是什么问题,我们将不胜感激。C:\Users\username\AwesomeProject>react-nativerun-androidScanningfoldersforsymlinksinC:\Users\username\AwesomeProject\node_modules(62ms)StartingJSserver...Buildingandinstallingtheapponthedevice(cdandroid&&gradlew.batinstallDebug).

prometheus+node_exporter+grafana+alertManager+prometheus-webhook-dingtalk实现服务器监控显示,钉钉机器人告警消息通知

1.下载prometheus安装①从https://prometheus.io/download/下载相应版本,安装到服务器上官网提供的是二进制版,解压就能用,不需要编译[root@loaclhost~]#tarxfprometheus-2.5.0.linux-amd64.tar.gz-C/usr/local/[root@loaclhost~]#mv/usr/local/prometheus-2.5.0.linux-amd64//usr/local/prometheus直接使用默认配置文件启动默认端口为:9090[root@loaclhost~]#/usr/local/prometheus/p

Android - 如何创建永久通知

我已经在我的“onCreate”Activity方法中创建了一个通知。一切运行顺利,只是您可以通过按“全部删除”按钮将其关闭。如何使此通知永久化?因为它应该只是更多的信息而不是通知..这是我当前的代码:privatevoidshowNotification(){//TODOAuto-generatedmethodstubnMN=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);Notificationn=newNotification.Builder(this).setContentTitle("WhipAndWee

android - 从通知 Intent 中删除数据

我的启动器ActivityIntent有问题。场景是:1.将intents表单通知服务发送到我的启动器ActivityPendingIntentcontentIntent=PendingIntent.getActivity(this,TripLoggerConstants.PENDING_TRIPS_NOTIFICATION_ID,newIntent(this,MainActivity.class).putExtra("is_log",true),Intent.FLAG_ACTIVITY_CLEAR_TOP);2。在我的MainActivity中,我得到了这个Intent。代码是:if

android - 在 android 中为通知设置振动、灯光或声音的组合

我想为用户提供选择Lights、Sounds或Vibration或这三者的组合的选项,以在Notification上发出警报。在android文档中,我看到有一个DEFAULT_ALL选项,其中将使用所有三种警报方法。否则有一个选项可以选择其中任何一个(DEFAULT_LIGHTS、DEFAULT_VIBRATE、DEFAULT_SOUND)。有什么方法可以组合SOUND和VIBRATION但没有LIGHTS和其他组合吗?编辑Notification.Builder的(来自prolink007的回答)方法setDefaults(intdefault)说:Thevalueshouldbe

使用 XMPP 的 Android 推送通知

我已经仔细阅读了所有关于主题和Android推送通知的帖子。基本上,为了一小笔钱,根据这篇文章Android&(millionsof)pushnotifications,定义了三种可能性:GoogleCloudMessage、MQTT和XMPP。关于GoogleCloudMessage,我看到了一些优点和一些缺点(Android版本、已安装GooglePlay、活跃的google数量、不保证按顺序发送通知等......)MQTT不知道,但我放弃了我的阅读或它们的复杂性和与其他组件的难以集成。我选择了XMPP,因为它是我用来制作游戏应用程序的服务器。当您玩游戏并且玩家A移动时,它会在他与

android - 当服务被 Android 操作系统破坏时删除通知

我创建了一个应用程序,它在执行Service.onStartCommand()方法时显示通知,在调用Service.onDestroy()时隐藏通知。它适用于对startService()和stopService()的正常调用。服务代码:@OverridepublicIBinderonBind(Intentintent){returnnull;}@OverridepublicvoidonCreate(){super.onCreate();nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);}@Overridepu