Questions tagged [android-background]
370 questions
4
votes
0 answers
App restart when revoke from background after some time?
In my android Application,I have an issue in which if I open app from background after some time (30 or 40 min) , that time my app got restart can any one have suggestion on it.
I have gone through almost question before asking this one,but can't…

Shailesh Bandil
- 497
- 7
- 20
4
votes
1 answer
Set job scheduler when screen is on (device NOT idle)?
I know that the method setRequiresDeviceIdle(boolean requiresDeviceIdle) makes the job run when the device to be in idle mode.
What I want is the opposite, I want the job to run when the device isn't in idle mode (screen is on and the user is using…

student93
- 307
- 2
- 12
4
votes
1 answer
Is it possible to make the background of an android app into a animated background like a gif?
I don't mean make a gif into a background just a background that moves. Thanks in advance. Any help is appreciated.

Sarju Thakkar
- 73
- 1
- 2
- 6
4
votes
1 answer
How to block restarting service when app closed on android?
App and background service are running together.But when app closed,background service is restarting?
Why? How can I do block this restarting?
When the application is closed, the service should continue like
nothing happened.How can I do…

erginduran
- 1,678
- 5
- 28
- 51
4
votes
2 answers
Execute web service on background every
I need to execute web service every Hour in the background
Every hour, will check if Internet is available then execute a web service and update data.
How can I do this?
My background service
public class MyService extends Service {
String…

user3722005
- 63
- 1
- 5
3
votes
1 answer
Can we startForegroundServie from an exact alarm's receiver in the background?
In one of the exemptions of the "cannot start foreground service from background" restriction, the doc mentions:
Your app invokes an exact alarm to complete an action that the user
requests.
Does this mean that the usage scenario below can…

thankyoussd
- 1,875
- 1
- 18
- 39
3
votes
1 answer
How to make Android app operational while it is closed?
I have an app that is supposed to intercept incoming calls, compare phone number with list created by the user and make silent mode if the caller is in this list, so I need my app to work always even if it was not launched by user. I tried a Service…

FarVoyager
- 49
- 4
3
votes
0 answers
API v29 restrictions on starting activities from the background
I have a ForegroundService that runs a large task. The user can press the home button or navigate away to a different app while the service runs. When the service completes or hits a "trigger" a new Intent is started. When the new Intent starts, I…

Tom
- 717
- 2
- 6
- 23
3
votes
0 answers
WorkManager: Periodic work not working expectedly
Note: I have already checked out multiple similar post and tried all possible general solutions, and also most of the respected posts were almost an year old or more. Now I'm re-raising issue w.r.t to observation and efforts.
Expectation: Firstly, I…

Raj Singh
- 95
- 6
3
votes
2 answers
How to persist data when Android needs memory and kills your app?
In my app, I'm working with some huge objects in memory, which are persisted when users use "save" function. The problem is that when the user leaves the app in the background, without saving, after some time, the OS removes those huge objects from…

NullPointerException
- 36,107
- 79
- 222
- 382
3
votes
1 answer
Need to have one background task to run for every minute in android
In one of my android applications, I need to run a task for every minute. It should run even if the app closes and when device is in Idle state also.
I have tried handler, it is working fine when device is active, but not working when device is in…

angrybird
- 45
- 1
- 6
3
votes
2 answers
Starting activity from Service when phone is locked Android 9.0(Pie)
Hello I'm working on VoIP feature for the app and I'm trying to handle cases when app is killed. My idea is to go with FCM notification and run activity which will show user incoming call screen. It works as expected when phone is unlocked but not…

harisk92
- 1,088
- 1
- 14
- 24
3
votes
1 answer
How to perform background service while battery optimization is active
I currently use the Firebase JobDipatcher to perform a periodic task in the background. The problem is the background service only gets executed when battery optimization is disabled and standby state of the app is manually set to ACTIVE under…

Noyal Jose
- 187
- 3
- 15
3
votes
2 answers
How do I detect network state /wifi state has changed while my app is in the background?
I am trying to figure out how do I detect wifi state change while my app is in the background.
To give a summary of my issue.
In my activity I register a receiver OnStart()such that :
IntentFilter networkIntent = new IntentFilter();
…
user2386226
3
votes
1 answer
Socket connection in background
I need to make an application where, while the user is authorized, it keeps the socket connection until it is logged out. For this purpose, a foreground service is created, which starts after the authorization of the user, and stops when it is…

Vyacheslav Martynenko
- 307
- 1
- 5
- 16