All Questions
Tagged with android-service android-notifications
253 questions
0
votes
1
answer
70
views
my app does not send the notifications in scheduling on android studio
I've been working on this project for a few days, and either it sends a notification at the moment I schedule it or never. As it stands right now, it creates the channel and the notification, but it ...
0
votes
1
answer
88
views
Recording screen from notification instead of MainActivity and using multiple notifications for each recording?
Not sure if this is the right place since this question might be flagged as opinion-based however what I need is mainly advice on the architecture.
I have developed an app that record the screen (...
0
votes
1
answer
279
views
Broadcast receiver being called fine, but not showing notification
I have implemented a broadcast receiver to ask the user to restart the app if it is killed. I have confirmed that the broadcast receiver is being called fine, and it runs the below line but for some ...
5
votes
0
answers
881
views
Notification is not showing with workmanager foregroundInfo
I wanted to create a notification with heads up feature . Basically it is a alarm feature. And I wanted to show with notification using foreground. Now workmanager has the feature to run in foreground ...
1
vote
0
answers
106
views
How to track the removal of the application and send a notification?
There is a task to make it so that when an application is deleted from the phone, my application sends a notification: "application name" has been deleted.
I do it like this:
Manifest
<...
0
votes
0
answers
391
views
NullPointerException in DoInvoke because of null receiver
Among our users, Samsung phones have this problem, and the cause cannot be found anyway.
Has anyone encountered the same problem? Can you tell me the reason?
Process Name: 'packagename'
Thread Name: '...
1
vote
0
answers
843
views
what is difference between setForeground and setForegroundAsync in kotlin
Hey I am working in WorkManager. My code is running in android 11 and below . I want to support WorkManager for sdk 31(android 12). I am reading doc and it confused for my scenario Backwards ...
4
votes
0
answers
914
views
Forground service and workmanager notification continues to show even after stopping the workmanager
This is a simple example of workmanager as a forground service. The problem is that forground notification is showing even after the workmanager is stopped. I feel like the problem is related to ...
1
vote
3
answers
412
views
audio player service stops when phone sleeps [duplicate]
I am running audio player service but If I put my phone on sleep the player stops or the background service I don't know what's the problem.
this is my music service class :
public class MusicService ...
1
vote
0
answers
474
views
On Android 11 setMediaSession on Notification then call stopSelf won't trigger onDestroy in MediaBrowserServiceCompat
I've tried to scope down the code as much as possible to identify the problem (although may have missed some pieces) but essentially I'm having an issue that occurs for Android 11 or higher where the ...
0
votes
1
answer
1k
views
Hide notification icon from status bar android
I have an issue with hiding the notification icon in the status bar from a service notification.
Here what I did:
I set the notification priority to min, make them silents
NotificationCompat....
0
votes
0
answers
71
views
check server change every 10 minutes and show changed in notification
I working on new project that I want to every 10 minutes show me the changed parameter from server in notification.
and it should work in the background and if it's possible when application is closed....
2
votes
1
answer
967
views
Bad notification for startForeground error when starting a service in android studio
The error message is: android.app.RemoteServiceException: Bad notification for startForeground
also dont know if its worth mentioning but the service starts normally on mac os.
My code:
public class ...
0
votes
0
answers
252
views
Receive notifications after app is in Doze
Given
Target OS versions: 4.4 – 10;
App meant to be published in Google Play;
App idea is public transport tracking (notifying when the specific bus is about to arrive to specific bus stop).
Problem
...
0
votes
0
answers
58
views
Should I move all the code inside onStartCommand() instead of onCreate()?
From what I understand the onCreate() method is only called only once (when the Service is instantiated), that would be the first time I execute startService(intent), so it basically works like a ...
1
vote
2
answers
2k
views
Android Developing: notifications don't show when app is closed
How can I send scheduled notifications in Android Studio?
I got this task: I want to get notifications at the some chosen time of the day every day. I can easily get them when app is alive, but when ...
1
vote
1
answer
730
views
Implementing exit app button in the persistent notification
My app runs a background service indicated by the persistent notification. Users need to use the toggle button in MainActivity to turn on/off this service and thus to remove the persistent ...
3
votes
1
answer
1k
views
Nav Deep Link from a foreground service
I'm trying to navigate to a fragment in my navigation graph from a foreground service notification. I used the below code to create an explicit deep link which didn't work out as expected.
val ...
1
vote
1
answer
556
views
FCM Service gets killed after i swipe my app from multi task tray
I have an app that triggers incoming calls by FCM data message(priority: high, no notification payload).
When the app is in the foreground or background, the app receives calls.
For the above case, ...
1
vote
3
answers
8k
views
Bad notification for startForeground error in Android
The error occurs when starting a foreground service with notification.
I am trying to load the data from the JSON file to my database. Since the file is large, I am using foreground service to show ...
1
vote
1
answer
1k
views
Notification not showing in Android 8 and above when app is killed
i want notification when app is killed using services, but when application is killed notification not showing in android 8 and above. here is my code that works fine on android 7 but not on android 8 ...
2
votes
1
answer
3k
views
Send Daily Notification at a scheduled time android
I am trying to send notification daily at 10am.
The code works fine when app is running and in background, but it does not work when the app is terminated/Killed.
Here is what I am doing,
In Manifest:
...
3
votes
1
answer
1k
views
How can I create a notification channel for Android API level < 26 (before Android Oreo)? [closed]
I am currently working with an Android service:
https://developer.android.com/guide/components/services
I am creating a service that has to be a foreground service.
But looking at the documentation, a ...
3
votes
2
answers
3k
views
Foreground service start once and display activity on click
I have 5 activities in my app. Every activity starts the same foreground service.
In onStartCommand method of the service foreground notification is created which unfortunately means that every call ...
1
vote
0
answers
707
views
Android foreground notification disappears
I have an ask where my app runs a foreground service. The foreground service Notification will have a play or pause option, clicking which will start or stop the corresponding service (of which the ...
7
votes
0
answers
3k
views
Getting error Attempted to start a foreground service (xxx) with a broken notification (no icon: Notification(pri=0 contentView=null ---
I do not understand this error message in Android Studio. Looking at the source code this error is caused by the small icon being null. But I set the icon (both large and small) and the notification ...
0
votes
1
answer
366
views
Why a pending intent does not start an activity when called form a service's notification
On my Github acccount I made a simple projet that delineate my problem here my project
My Main Activity has a button whose onClick method calls a Background Service.
The Backgroundservice wait for 5 ...
3
votes
1
answer
480
views
Receiving explicit intents while activity is in the foreground
My app has one activity and one service. The service starts a foreground notification that has an action button that in some situations needs to tell the activity to do something besides just coming ...
2
votes
0
answers
2k
views
Unable to instantiate service, has no zero argument constructor
The Search :
For days, I've been looking at how to control MediaPlayer which is running inside a Service.
Basically, media controls in a ForegroundService/NotificationCompat
And I read an answer, ...
1
vote
0
answers
419
views
Android local notification does not fire after system reboot
I implemented some notifications that fire on specific date and time. My code works if phone is not rebooted after app installation, but if I reboot the phone the notifiction does not fire. I tried ...
2
votes
0
answers
547
views
ListenableWorker done, but ongoing foreground notification still exists?
I am trying to use ListenableWorker to perform some background API calls.
During this process I want to display notification with a progress.
I use setForegroundAsync() function as per this ...
1
vote
1
answer
370
views
NotificationListenerService doesn't detect missed calls notification
I'm using NotificationListenerService to detect when there's a new notification and when it's cleared. It works fine for all apps except for when there's a missed call notification, it doesn't detect ...
2
votes
2
answers
2k
views
Unable to start receiver, app is in the background. AlarmReceiver to fire Notification
In my app, I use AlarmManager to start IntentService that accesses internal database of quotes and selects one randomly, then fires a notification with that quote.
It is working perfectly on my phone ...
0
votes
1
answer
1k
views
Notification Listener Service not always working
I'm trying to work on an app that sends notifications to my pc.
I used an NotificationListenerService which seems to work on an Emulator(Pixel XL API29) but when trying it on my Oneplus 7 Pro (Android ...
1
vote
2
answers
274
views
Android 8.1.0 Forground service notification issue
[I face same issue which was already reported on stackoverflow][1]When start forground service in 8.1.0 I got notification with application crash.Error log is as below.Its working fine in android 8.0 ...
0
votes
0
answers
139
views
Notification Manager with Proguard
I am trying to create foreground service.
After minifyEnabled true on the release build of the project. I am facing compilation issue on NotificationManager.createNotificationChannel(Not giving any ...
1
vote
1
answer
131
views
How to cancel service from BroadcastReceiver API 26+
I'd like to cancel my service on the user action (i.e a cancel button on the notification)
It's working on API < 26, but not on 26+. I'm looking for help to fix this if possible.
Here is my code:
...
0
votes
2
answers
418
views
should i call startforeground(id, notification) if i recreate notification? android above Oreo, api28
Hi !!
I am wondering if I should call startForeground(id, notification) whenever I create Notification Object.
or is it okay calling NotificationManger.notify(id, notification) ?
Here is a sample i ...
5
votes
2
answers
8k
views
java.lang.NoSuchMethodError: No virtual method startForeground
I'm trying to lauch a foreground service, but receiving NoSuchMethodError. It says that no startForeground found, but it looks like it is present. I do have the service and the android.permission....
0
votes
2
answers
44
views
Notification Pops-up only few times then stops. Running Background Service Periodically
I am developing an App where I need to run a background service every 3 minutes to fetch some data in JSON format from the server.
Right now, for testing purposes, I am trying to hit the service to ...
1
vote
1
answer
165
views
FirebaseMessagingService push notification creation - how to set icon?
I want to set icon for my push notification which is created by FirebaseMessagingService. Problem is that these notifications are created by system internally (probably in function onStartCommand() ...
-1
votes
1
answer
30
views
SERVICE FOR NOTIFICATIONS
Can anyone tell me how to do a service that will generate a notification every day at a certain time (for example at noon)?
Or rather, do I need a service to do this?
Naturally I am talking about ...
1
vote
0
answers
17
views
How to create scheduled website parse and notification on it?
I'm setting up my website+android app link. On my website I can check notifications. I want to check my website for a new posts, and if it exists, make notification on it.
I think I need to make ...
1
vote
0
answers
891
views
Notification Access Permission Not Working When App is Closed(oppo,vivo and mi)
I'm developing an app (Notification History Log for Everyone).
I received a lot of negative reviews from the user using MIUI and Color OS saying the app is not working. I checked with Redmi Note 4 ...
1
vote
0
answers
268
views
Can I use startForeground(id, notification) in a service to update notification progress bar properly?
I have a situation where I need to update the notification progress bar after some few more milliseconds. If I use notification manager to update the progress, then the notification will show up even ...
0
votes
0
answers
291
views
How to update a notification when a service stopped - Android
I have a Service that downloads a database and displays a notification that contains a progress bar indicating download progress. I want to update that notification when the service stops abruptly ...
3
votes
1
answer
289
views
BroadcastReceiver not being called when pressing Notification Button
Inside the onCreate method of my Service I create a notification by doing the following:
String channelId = "001";
String channelName = "myChannel";
NotificationChannel channel = new ...
-3
votes
1
answer
54
views
Foregroundservice startforeground doesn't show notification
I have a channel defined, and notification defined that I send to startforeground with notification Id different from 0.
I also searched in google lot, but I can't find- why startforeground doesn't ...
0
votes
1
answer
72
views
How to stop all notifications and alarms if app is killed by swiping?
I want to cancel all of my notifications and alarms set in background as app is killed by swiping. This action will not trigger onDestroy() inside my root Activity.
I made a background service to ...
0
votes
1
answer
2k
views
Anndroid : How to send broadcast intent to service from notification action?
I'm trying to send a broadcast intent from within a notification action on Android but kind of lost here.
I have an android service that recieves broadcast intents from activities/frgaments and react ...