Skip to main content
How are we doing? Please help us improve Stack Overflow. Take our short survey

All Questions

0 votes
0 answers
45 views

How to perform long-running tasks in the background without show any notification?

I want to run an any update process silently in the background without showing a notification. Android's restrictions require notifications for long-running background tasks using Foreground ...
Kartikeya Gupta's user avatar
0 votes
1 answer
112 views

Timer task with foreground service

I'm doing a timer task in main thread and I'm updating my ui every 15 seconds there. I'm also running another timer task in a foreground service (when the user turns it on. it is aimed for background ...
Alireza hoseini's user avatar
1 vote
0 answers
320 views

Android 12 and 13 OS - Activity Recognition With broadcast receiver in background stop giving me Recognition Results after few hours or days

I am trying to get user activity states by Activity Recognition API and it works in foreground and for few hours in background too (When user exit the app) but after more than 4/5 hours or after 2 or ...
kiran malvi's user avatar
  • 1,025
0 votes
0 answers
30 views

ForegroundApp Checker returns null after an hour of running through service :

I am using the below code which works fine till an hour afterwards it returns foreground app package name null AndroidManifest.xml : <uses-permission android:name="android.permission.GET_TASKS&...
Arpit Jaiswal's user avatar
0 votes
0 answers
114 views

Background Service is getting killed after 10 minutes or so

I have created a service which is responsible for sending current location on server every 60 seconds. I am using this as a foreground service, creating a foreground notification. But its been noted ...
xx90TDrgA's user avatar
0 votes
1 answer
2k views

How to launch an app from foreground/background service?

I am new to the android development in java so apologies if this question is so simple. Basically I am aiming for restarting the application after it crashes without user manually pressing the app ...
Shazer 's user avatar
1 vote
0 answers
670 views

android.app.ForegroundServiceStartNotAllowedException Service.startForeground() not allowed due to mAllowStartForeground false

i have a mediaplayer java class that connect to service to show notification, the service dose'nt stop except when user clicks the notification cancel button notification = new NotificationCompat....
Abdullah's user avatar
  • 1,661
0 votes
1 answer
1k views

Executor block main thread - ANR triggered by main thread waiting for too long

I was analyzing the firebase log (crashalytics) and I noticed a particular error related to the function posted below. jdk.internal.misc.Unsafe.park ANR triggered by main thread waiting for too long ...
Mattia's user avatar
  • 1,117
1 vote
0 answers
157 views

Is there any possible solution to detect when Android OS kill background Service?

I'm working on android based application and facing a problem on VIVO Y15s [Funtouch OS 12 Global] that this device kill background service/task automatically after 5 to 6 minutes. and there is no ...
Ahmed Rehman's user avatar
1 vote
1 answer
517 views

Want to set Alarm even when App is closed and when mobile device is in sleep mood

I want to notify the user at a specific time using Alarm Manager. I have go through many answers and implemented but not working. The following code is working fine when App is running. It is not ...
Block Person's user avatar
2 votes
1 answer
8k views

Android: Check if my app is allowed to run background activities

I have an app that runs a stopwatch service, and I run the service in the foreground. I have a notification showing the timer, that updates each second. The notification stops updating 30 seconds ...
Nitzan Daloomy's user avatar
0 votes
0 answers
38 views

unable to update the FireBase database from a service

My service is running in the background. I am getting the toast notification of the latitude and longitude but my database is not getting updated. In the onCreate() function I am calling the ...
Vinayak Bansal's user avatar
2 votes
4 answers
4k views

Android: Notification Shows in Delay And Stops Updating When App Closed for 30 Seconds (on OnePlus 8T)

Google has its clock app, which includes its stopwatch. I'm currently trying to create in my app a (count-up) timer, or you can call it a stopwatch, that will be able to run in the background, and ...
Nitzan Daloomy's user avatar
1 vote
2 answers
429 views

Bad notification for startForeground playerNotificationManagerBuilder.setNotificationListener

Hello I'm building a stream music app and when I tried to set the setNotificationListener I receive this error and the app crashes for the record, I already can show the notification but after ...
Juan Christopher Bazaldua Rami's user avatar
0 votes
1 answer
904 views

Current Location in background Service in android does not work [duplicate]

The code below does not work when the application is minimized or closed and doesn't return the current location. For example, locationCallback only works once and does not work after the app is ...
vahid asghari's user avatar

15 30 50 per page
1
2 3 4 5 6