android-notifications

ListenableWorker does not remove notification icon

╄→гoц情女王★ 提交于 2020-07-18 22:35:32
问题 I am using ListenableWorker to perform background tasks. Also I want OS to be aware of my service importance, so I call setForegroundAsync(new ForegroundInfo(WorkerConstants.NOTIFICATION_FOREGROUND_ID, builder.build())); As suggested in the google documentation. But when my service stopped or cancelled, i can still see foreground service notification and i cannot remove it. Furthermore, I added cancel button to this notification, but it does nothing, I cannot close it: PendingIntent intent =

Android samsung custom notification heads up view

偶尔善良 提交于 2020-06-29 14:08:45
问题 When notifications from some applications are displaying on Samsung S8 Touchwiz there is a custom view with nice animation and ellipsized text. For example message notifications in Telegram. Any ideas how to make my notification work like this on samsung? Tried all parameters in NotificationCompat.Builder but no success yet. Thanks. It look's like this: 回答1: I managed to figure out how you can make the notifications appear in such way on Samsung devices. The Samsung have "Edge lighting"

Android samsung custom notification heads up view

岁酱吖の 提交于 2020-06-29 14:03:17
问题 When notifications from some applications are displaying on Samsung S8 Touchwiz there is a custom view with nice animation and ellipsized text. For example message notifications in Telegram. Any ideas how to make my notification work like this on samsung? Tried all parameters in NotificationCompat.Builder but no success yet. Thanks. It look's like this: 回答1: I managed to figure out how you can make the notifications appear in such way on Samsung devices. The Samsung have "Edge lighting"

NotificationManager.notify creating notifications that are *initially* missing contentText

拈花ヽ惹草 提交于 2020-06-28 07:25:10
问题 When posting a push notification to the Notifications List/Bar, the .contentText and the .number are initially not displayed (.ticker, .icon and .contentTitle display fine). However, after posting another notification (with a different ID), when the first one gets bumped down in the list, it then displays the content text and number. And then the new one is missing the text, and so on. Since I'm using the millisecond timer to create a unique ID, I don't think it's possible for me to be

Opening the App from Recents opening the old activity in Android?

喜夏-厌秋 提交于 2020-06-28 03:57:14
问题 I have 4 Activities: Launcher, MainActivity(SingleTask), NotificationActivity, ExampleActivity. When the user clicks on the notification, NotificationActivity opens then ExampleActivity and finishes the NotificationActivity . When I press back MainActivity opens. Now if I press back, the application gets closed. If the user then opens the app from the recent Tasks, NotificationActivity opens then ExampleActivivty . But if the user opens the app from the icon, Launcher Activity opens then

BroadcastReceiver not firing on notification action click

被刻印的时光 ゝ 提交于 2020-06-16 05:06:48
问题 I am trying to create a simple notification with a button (action) defined to it. I have managed to display it properly and create a PendingIntent for my action. I have also created a BroadcastReceiver which is supposed to be called when my action is clicked. But it's onReceive() method does not get called. I have no idea why. I also registered BroadcastReceiver in AndroidManifest.xml MainActivity.java public class MainActivity extends AppCompatActivity { @Override protected void onCreate

Android O - Notification Channels and NotificationCompat

孤者浪人 提交于 2020-06-09 11:44:28
问题 I cannot change this feeling: again, the Android developers came up with something new and leave everybody in the dark about how they would think the feature is used. I am talking about Notification Channels in Android O. For years I have been using the compatibility support libraries to avoid dealing with specific platform details. Namely: NotificationCompat . Now, the Builder requires me to supply a notification channel id, which is nice, but completely leaves me alone with creating such a

Protocol used for sending push notification in Android

陌路散爱 提交于 2020-06-09 11:19:10
问题 I want to know which protocol is used to send push notification to android devices and which to send push notification requests to GCM. Whether it is HTTP, HTTPS or some thing else? 回答1: The protocols of the communication between the 3rd party server and GCM server (HTTP or XMPP) were already mentioned in the other answers. The protocol of the communication between the device and GCM server is not discussed in the GCM documentation, since you never have to access it directly as an Android

Protocol used for sending push notification in Android

人盡茶涼 提交于 2020-06-09 11:19:10
问题 I want to know which protocol is used to send push notification to android devices and which to send push notification requests to GCM. Whether it is HTTP, HTTPS or some thing else? 回答1: The protocols of the communication between the 3rd party server and GCM server (HTTP or XMPP) were already mentioned in the other answers. The protocol of the communication between the device and GCM server is not discussed in the GCM documentation, since you never have to access it directly as an Android

Firebase notifications not working in Android Emulator

喜夏-厌秋 提交于 2020-05-28 13:59:27
问题 I am developing an Android app which uses Firebase to send notifications. Everything works as expected when using my physical device (Google Nexus 5, and also tested on others), but I cannot receive notification when using the emulator. Platform: Windows Android Studio: 2.3.1 with Google Play Services 39 API: 24 Emulator: Nexus 6 API 24, Android 7.0 Any idea? 回答1: Have you tried using different emulator configurations, targeting the emulator from the Firebase console using the single device