Questions tagged [android-background]

370 questions
116
votes
14 answers

Determining the current foreground application from a background task or service

I wish to have one application that runs in the background, which knows when any of the built-in applications (messaging, contacts, etc) is running. So my questions are: How I should run my application in the background. How my background…
dhaiwat
  • 1,731
  • 4
  • 16
  • 16
73
votes
9 answers

Scale image keeping its aspect ratio in background drawable

How do I make a background image fit the view but keep its aspect ratio when using as a background drawable XML? None of 's android:gravity values gives the desired effect.
tilex
  • 1,744
  • 1
  • 17
  • 32
34
votes
11 answers

Android: Background image resize on keyboard pop up

I am developing an application in which the background image get shrink on keyboard pop-up. My .xml is as follows :
Manoj Fegde
  • 4,786
  • 15
  • 50
  • 95
20
votes
3 answers

Background execution not allowed receiving intent BOOT_COMPLETED

I've read about Android Oreo background execution limitations, and it clearly states that BOOT_COMPLETED broadcast is unaffected, but I can't get it to work on Android Oreo. First, I am compiling against SDK 27. Secondly, I declared the receiver…
19
votes
3 answers

Android - State Selector Animations - Only animate de-press, NOT press

I have a very basic selector that I am using as the background for some buttons to achieve down states. Here's the xml:
16
votes
1 answer

Set "allow" permission by default in "Asus auto start manager" from code

I have an application which needs to run in the background, so I'm using a WakeFullService for that. But in Asus Zenfone it's not working because Auto start manager does not allow the app to run. My expectation is: To set "allow permission" in auto…
15
votes
1 answer

way to Ignore ssl certificate using HttpsURLConnection

I use two approaches to try to consumes HTTPS URL: The old deprecated and return response with the right values. Here is the code it didn't need ignore ssl certificate it ignore it by itself or may use other technique: public String…
androidAhmed
  • 227
  • 1
  • 4
  • 16
14
votes
3 answers

SearchView remove blue focus line and show cursor at certain position

I have been trying to remove the blue focus line in the SearchView .I am casting it to a AutoCompleteTextView so that I can use customized icons for my searchView. int id =…
11
votes
4 answers

Bind to service from new Context for configuration changes or bind from app context?

I'm trying to work out if bound service is appropriate for doing background work in my app. The requirements are that various application components can make web requests through it of varying priority. (Thus the service must maintain some sort of…
11
votes
6 answers

How can I convert String to Drawable

I have many icon in drawable folder and I have their name as String. How can I access to drawable folder and change background imageView (or any view) use these name in dynamically. Thanks
Utku Soytaş
  • 1,475
  • 2
  • 19
  • 30
10
votes
1 answer

How and on what condidtions are FCM high-priority messages de-prioritized? How to fetch cached FCM messages from server?

According to FCM documentation high-priority messages might become de-prioritized, if the FCM server detects a pattern in which high-priority messages do not result into user interactions. The details of this mechanism are left unspecified.…
10
votes
5 answers

Android Dash/doted line issue?

When I am using android dotted line its working fine in Small screens, but not working in Samsung S3 device and higher versions. Screenshots And drawable/dashline.xml
NagarjunaReddy
  • 8,621
  • 10
  • 63
  • 98
9
votes
6 answers

Error: The file name must end with .xml or .png

Even though I didn't choose photothumb.db as a drawable, I get an error saying photothumb.db should end with .xml or .png my profilesmaller image is of type png Below are my codes
Char
  • 2,073
  • 8
  • 28
  • 45
9
votes
2 answers

How to find list of application accessed by user in a Interval using a background job?

I want to find out the list of apps accessed by user in a particular time interval (ex: 5min), from a background job? Is this possible on a non-rooted android phone? If possible I'm very much interested in knowing the answer as it will be a great…
Kishor
  • 4,006
  • 7
  • 30
  • 47
9
votes
4 answers

View with Solid Background and Top+Bottom Inner Shadows

Essentially, I am trying to create the following background: The traditional gradient which use in the drawable that I use for background only supports start color, middle color and end color. However, as you can see from the mockup, I am trying to…
Dzhuneyt
  • 8,437
  • 14
  • 64
  • 118
1
2 3
24 25