Questions tagged [android-background]

370 questions
8
votes
2 answers

WorkManager API for Exact time execution

I want to send offline notification to user periodically at exact time (assume daily 9:00 AM). Right now I was trying workmanager Api but not able to find any method like AlarmsManager's setExact or setexactandallowwhileidle. Only repeatInterval…
Ayush Jain
  • 563
  • 7
  • 11
8
votes
2 answers

Using ImageView as background for an Android Layout

I want to take advantage of the scaleType property, which I cannot use if I set my image using the background property on the LinearLayout. I've tried using a LinearLayout with 2 children: the first is an ImageView (for the background image) and the…
RTF
  • 6,214
  • 12
  • 64
  • 132
7
votes
2 answers

Is an android Service a singleton?

If I start a service in my main activity, then exit main and create main again, will a new service instance be put in its place? or will it be the same instance? or will there be two instances? I need to know because in my service I make a unique id…
7
votes
1 answer

How to change the screenshot shown by recent apps list in android?

I am creating an application wherein I am having a lock screen which comes up whenever the application moves to the background. I want that on pressing the recent apps, the screenshot of my application(or that activity) be avoided. One way is to use…
android developer
  • 1,253
  • 2
  • 13
  • 43
7
votes
5 answers

Changing TextView background color on click android

I'm trying to change the background of a textview when clicked. For instance, if the textview is click it the background changes to yellow and remains yellow until it is click again. Then it returns to its default background. Currently textview the…
capiono
  • 2,875
  • 10
  • 40
  • 76
6
votes
2 answers

how to create a PERMANENT background service on android

I'm having a nightmare trying to create a simple background service on android that runs permanently. This service will be doing some background tasks like pool users social media and show notification so it requires only one user interaction…
Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
6
votes
2 answers

How to set the period of a periodic task in Firebase JobDispatcher?

I've read every available official docs (which is surprisingly not a lot) and all I could get for periodic tasks is this code .setRecurring(true) // start between 0 and 60 seconds from now …
6
votes
4 answers

Alpha background on FAB clicked

I'm using the library https://github.com/futuresimple/android-floating-action-button to create the fab buttons that works pretty well. I tried several libraries but none use the effect used in most application with a fab (or Google apps like keep,…
Atlas91
  • 5,754
  • 17
  • 69
  • 141
6
votes
3 answers

Android PendingIntent FLAG_NO_CREATE does not return null

I have some trouble with PendingIntents. Every time my app is opened it will schedule some broadcasts. My Problem is that already existing PendingIntents aren't recognized. I know that the PendingIntents and the unterlaying Intents must be created…
6
votes
1 answer

How can I fix GradientDrawable cannot be cast to ColorDrawable issue?

I have a code snippet to show you below and I am trying to change view's(v) background. I'll get color code from a TextView(dragged) and change View(v)'s background by using this code. But I get an error as indicate above. How can I fix it? Where is…
Utku Soytaş
  • 1,475
  • 2
  • 19
  • 30
5
votes
2 answers

Keep running background service (Android)

I create background service with is started after user signed in and should work even after activity was 'throw to trash'. Service show notifications that it's running ,register two broadcast receivers for monitoring wifi and phone state and should…
5
votes
2 answers

Android Periodic Work Request Start and Stop when the app is starting and closing

When my app is starting, I created a periodic work request using WorkManager to fetch the data from the server and its working fine. My problem is, I want to cancel the work request when my app is closing. How to cancel the work request when my app…
5
votes
0 answers

Disabling battery optimization

Huawei and Honor devices have a mode called "power intensive app" that notifies the user of abnormally consuming apps. Settings > Battery > "gear icon" > "Close excessively power-intensive apps" > On/Off Is there a way to disable it…
5
votes
0 answers

React Native : Google maps service keeps running in Android devices even after the app is exited

When the app is in foreground everything seems to works fine. But when we force close the app the map service still seems to work even after the MapView has been destroyed. We are running a background service which lets the app run in background.…
4
votes
2 answers

Background processing in modern Android

I have implemented some background task with WorkManager and with usage this Guide. One time I needed to use CoroutineWorker. I find these guide pretty good but every time I need new requirement for background processing I start new research for…
Dim
  • 4,527
  • 15
  • 80
  • 139
1
2
3
24 25