草庐IT

NOTIFICATION

全部标签

android - Notification PendingIntent Intent extras 被另一个通知覆盖

使用新的PendingIntent创建新通知时,其Intent中的额外内容会覆盖任何先前通知的PendingIntentIntent额外内容。例如,假设我使用PendingIntent1创建了Notification1,它具有Intent1及其附加功能。当我使用PendingIntent2创建Notification2时,Intent2具有自己的不同额外功能,Intent1现在将具有与Intent2相同的额外功能。为什么会这样?我该如何解决这个问题? 最佳答案 有两种方法可以解决这个问题:一种是在Intent上设置不同的action

android - NotificationListenerService中如何获取Notification内容详情

我想获取RemoteView的内容详情来自StatusBarNotification边听NotificationListenerService我怎样才能得到它? 最佳答案 解决方法RemoteViewsremoteView=statusBarNotification.getNotification().contentView; 关于android-NotificationListenerService中如何获取Notification内容详情,我们在StackOverflow上找到一个类

android - RemoteServiceException : Bad notification for startForeground: java. util.ConcurrentModificationException

android.app.RemoteServiceException:BadnotificationforstartForeground:java.util.ConcurrentModificationExceptionatandroid.app.ActivityThread$H.handleMessage(ActivityThread.java:2204)atandroid.os.Handler.dispatchMessage(Handler.java:108)atandroid.os.Looper.loop(Looper.java:166)atandroid.app.Activit

android - NotificationManager.cancel() 不起作用 : Notification isn't removed

我一直在尝试使用以下方法删除由服务设置的持久通知:startForeground(1337,notification);我用来取消它的代码:NotificationManagernManager=(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);nManager.cancel(1337);//cancelexistingservicenotification,doesn'ttakeeffectnManager.cancelAll();//surpluous,butalsodoesn't

android - 非法状态异常 : The content of the adapter has changed but ListView did not receive a notification

我正在使用自定义ArrayAdapter在AutocompleteTextView上设置适配器(AddressAdapter扩展ArrayAdapter)。publicclassAutoCompleteAdapterextendsArrayAdapterimplementsFilterable{privateArrayListmData;ArrayListlistTempPrefix=newArrayList();ArrayListlistTemp=newArrayList();StringvalueText;String[]words;Stringulcase;publicAutoC

Android:如果将 Activity 带回屏幕,Notification 的 PendingIntent 不会触发 onCreate()

我猜我对IntentFlags有一些误解。我想做的是,我有一个radio流应用程序,它有两个Activity(PlayerApplication和SettingsScreen)。我有一个在后台运行的用于流媒体的Service.class,它也包含一个通知(您可以在通知覆盖菜单和PlayerApplication中停止/开始播放)。如果用户点击通知,PlayerApplicationActivity应该返回屏幕。一切正常,预期情况:用户打开SettingsScreenActivity->打开NotificationOverlayMenu->点击Notification->PendingI

Android Notification.PRIORITY_MAX 已弃用 在顶部显示通知的替代方法是什么?

如何在顶部显示安卓通知?setPriority(Notification.PRIORITY_MAX)由于Notification.PRIORITY_MAX已弃用,有什么替代方案?NotificationCompat.Builderbuilder=newNotificationCompat.Builder(context).setContentIntent(pendingIntent).setSmallIcon(R.mipmap.ic_launcher).setContentTitle("NotificationTitle").setContentText("NotificationTe

android - Android中是否有类似Apple Push Notification Service的推送通知服务?

我想为Android手机用户提供推送通知服务,Android中有没有类似ApplePushNotificationService的推送通知服务? 最佳答案 哦,是的!它叫做C2DM.请检查一下!编辑:Tutorial已添加链接!编辑:为了完整起见,C2DM现已弃用,取而代之的是GoogleCloudMessaging编辑:GCM现已被FirebaseCloudMessaging取代 关于android-Android中是否有类似ApplePushNotificationService的推

Android 有时我得到 android.app.RemoteServiceException : Bad notification posted from package. 为什么?

我的通知有一个严重的问题。有时,当我的应用发布相同的自定义通知时,我会收到此错误:android.app.RemoteServiceException:Badnotificationpostedfrompackagecom.packagename:Couldn'texpandRemoteViewsfor:ClassName(package=com.packagenameid=0tag=nullnotification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x22))atandroid.app.ActivityT

android - Firebase 云消息传递 - Android : click-action of notification when app is closed doesn't work

我正在使用FirebaseCloudMessaging将数据消息传送到我正在开发的应用程序。根据FCM文档,当应用程序处于前台时:AclientappreceivesadatamessageinonMessageReceived()andcanhandlethekey-valuepairsaccordingly.而且效果很好。当应用程序在后台时,行为是不同的:thedatapayloadcanberetrievedintheIntentusedtolaunchyouractivity.而且它似乎不太好用。我在通知JSON中使用“click_action”参数,我在其中指定要打开的“Ac