草庐IT

silent-notification

全部标签

java - Android:Notification.DEFAULT_VIBRATE 是否需要振动许可?

有时我会读到它notification.defaults|=Notification.DEFAULT_VIBRATE;和notification.defaults=Notification.DEFAULT_ALL;需要振动许可但有时我读到它不是。哪一个是正确的信息? 最佳答案 好吧,显然,您确实需要振动许可。谢谢! 关于java-Android:Notification.DEFAULT_VIBRATE是否需要振动许可?,我们在StackOverflow上找到一个类似的问题:

android - 未找到输出 : error: resource style/TextAppearance. Compat.Notification.Info(又名 package_name :style/TextAppearance. Compat.Notification.Info)

切换到AndroidStudio3.2canary后,我收到以下构建错误。我看过this发布这个人有类似问题但没有提到解决方案的地方。我想尝试新的Material组件和喷气背包,所以有没有可能我不必切换回去。com.android.builder.internal.aapt.v2.Aapt2Exception:AndroidresourcelinkingfailedOutput:error:resourcestyle/TextAppearance.Compat.Notification.Info(akacom.nsnik.nrs.kotlintest.debug:style/TextA

如果使用 FLAG_NO_CLEAR,则不会显示 Android Wear Notification

如果使用标志“FLAG_NO_CLEAR”,通知将不显示在AndroidWear上。有谁知道原因或任何解决方法?我没有在文档中找到任何信息。我需要在我的通知上标记“FLAG_NO_CLEAR”,并有用于“关闭”、“暂停”等操作按钮! 最佳答案 通知标志FLAG_NO_CLEAR基本上使您的通知“持续”。从手机发布的持续通知不会显示在可穿戴设备上。对于您的问题,您有两个解决方案-它们各有优缺点。请阅读下面的文字并决定哪种解决方案可以更好地解决您的情况:)解决方案1-使用组:您可以使用AndroidWear框架的group功能。它基本上

android - 多条推送消息 : The content of the adapter has changed but ListView did not receive a notification

当我在1秒内从GCM收到大量推送消息(比如说50条)时,我收到以下异常:java.lang.IllegalStateException:ThecontentoftheadapterhaschangedbutListViewdidnotreceiveanotification.Makesurethecontentofyouradapterisnotmodifiedfromabackgroundthread,butonlyfromtheUIthread.[inListView(2131427434,classandroid.widget.ListView)withAdapter(class

android - 我可以检测 Android 设备上是否存在 'LED notification' 吗?

背景:我有一个带通知的应用程序,我想支持LED通知(并且运行良好)。在我的偏好中,我允许用户自定义LED通知。问题:如果设备不支持LED自定义选项,我不想显示它们,因为它可能会使用户感到困惑(如果您拥有的只是廉价的Android,您不知道LED通知是什么).是否有可用于检测设备是否支持它的API?如果有“旧”和"new"方式,我可能更喜欢旧方式,因为我支持的最低API级别是4。谢谢LED通知:如果启用,当您的显示屏关闭时,您手机的LED会闪烁以接收通知。 最佳答案 IsthereanAPIthatIcanusetodetectift

android - 如何从 RemoteMessage 中找出 Notification channel Id

我按照GoogleSampleshttps://github.com/googlesamples/android-NotificationChannels在Android应用程序中注册了通知channel但是我如何从RemoteMessage获取通知channelId,所以我可以将它设置为NotificationBuilder。publicclassFirebaseMessagingServiceextendscom.google.firebase.messaging.FirebaseMessagingService{@OverridepublicvoidonMessageReceiv

Android Notification.Builder : show a notification without icon

Stringns=Context.NOTIFICATION_SERVICE;NotificationManagermNotificationManager=(NotificationManager)getSystemService(ns);inticon=R.drawable.ic_notification_icon;android.app.Notification.Buildernbuilder=newNotification.Builder(this);nbuilder.setContentTitle(getString(R.string.notifcation_title,mPr

android - 找不到错误 :resource style/TextAppearance. Compat.Notification.Info(又名 {packageId}.test :style/TextAppearance. Compat.Notification.Info)

我刚刚将build.gradle编译SDK更新为27API。compileSdkVersion27buildToolsVersion'27.0.3'targetSdkVersion27但是一旦我点击同步按钮它就​​会抛出error:resourcestyle/TextAppearance.Compat.Notification.Info(aka{packageId}.test:style/TextAppearance.Compat.Notification.Info)notfound.error:resourcestyle/TextAppearance.Compat.Notificat

android - Firebase 控制台 : How to specify click_action for notifications

我实现了Firebase并测试了Firebase通知。当应用程序在前台时,我没有遇到任何问题,我实现了一项扩展FirebaseMessagingService并在onMessageReceived中处理消息和数据的服务我在应用程序处于后台时遇到问题,我想发送一个通知来打开特定Activity并执行我计划要做的事情,而不仅仅是打开应用程序。我按照Firebase指南中的描述进行了操作,但我无法启动特定Activity。这里是list:这里是Firebase控制台。我必须在这些字段中写什么才能打开我的“BasicNotificationActivity”? 最佳

c++ - 继承二级基类构造函数: silent error

我今天遇到了一个非常严重的错误,这是一个MWE:#includeclassX{public:X(){std::cout与我的预期相反,打印了“Default”。不可否认,代码是错误的,因为Z的继承构造函数试图初始化X而没有指定如何构造Y(∗).但是,编译器不应该提示吗?Y(以及随后的X)的默认构造函数被调用,完全无提示地忽略我的参数3背后的基本原理是什么?这是否记录在标准的某处?还是我的编译器存在错误?我的环境是gccversion6.2.120160916(RedHat6.2.1-2)。即使使用-Weffc++-Wall-Wextra-pedantic也不会产生编译器警告。