Questions tagged [android-background]

370 questions
0
votes
2 answers

How to have a button have a ripple as well as a custom shape

When I try to have the two of them together but they will either override each other or the background becomes transparent. Button shape:
0
votes
2 answers

my services don't work when app completely closed

I know there are many question about this problem and i saw almost all of them, but i can't solve my issue . I have a service which call main activity using local broadcast manager , i get some value from this service and then i put them into string…
0
votes
2 answers

Android Activity back stack navigation

I have an app, that has several activities and one of them is acting like “reminder popup style” activity. This activity defined as NEW_TASK and is launched from service. But the problem is when this activity shows up, it always brings to front the…
Artyom Okun
  • 939
  • 1
  • 8
  • 14
0
votes
0 answers

Inherited ImageButton Background Padding

I'm creating a simple custom view. My view inherits from AppCompatImageButton with the goal of drawing some simple geometric shapes for my custom button and animating them. If my XML view contains: android:background="@color/transparent" My view…
Mitch
  • 1,716
  • 3
  • 25
  • 41
0
votes
0 answers

Android Studio setting background using RelativeLayout not working

I am beginner using Android Studio and am following a tutorial on changing the screen background using the following code: package com.example.gallcock.lighthead_app; import android.graphics.Color; import…
Greg
  • 1
  • 1
0
votes
1 answer

Notification when change is detected in android

I would like to send a notification in every state (app in background or running) when some data in firebase are changed the database. Do I need to use push notification from firebase? I use the xxx.keepSync(true) to sync with the firebase db. May…
0
votes
1 answer

Randomly Displaying Background Color in Android App

I am currently working on an android APP and I have a list of predefined color in my colors.xml. Now what I want to achieve is that I want to give the user the opportunity of selecting a color and from the color the user select, I want to display…
olasammy
  • 6,676
  • 4
  • 26
  • 32
0
votes
1 answer

Android - Custom background image

I want to change my app's background randomly. It's supposed to have a random image from its own folder as background. It works perfectly with some devices but with some of them doesn't. I wonder what could cause this inconsistency. Here is my…
Erayzer
  • 39
  • 1
  • 8
0
votes
1 answer

What is the efficient & structured way to use android drawable shape?

I need to use few buttons in my project with different design. So I'm using drawable shape to make custom button. Let's say I need a button with rounded corner and green background. So I've created a shape "gree_round_button.xml" and this works…
Robin
  • 446
  • 2
  • 4
  • 24
0
votes
1 answer

Timer code that can run in background

I want a timer code that can run in background and only stops when I want to. Basically, there are two buttons. Start timer and stop timer, and when I press the start button it starts the timer and it should automatically run in the background also,…
0
votes
1 answer

notification on background firebase show dialog when apps open

Sorry for my title, but let me explain this. I use firebase cloud messaging on my apps. Now, I need run the apps then show the dialog contain notification body and title when the apps not running or in background, after I touch the notification.…
0
votes
1 answer

How to prevent my android activity from going to isFinishing()?

I have activity1 and activity2. Activity2 contains an custom alert dialog, when i come from activity1 to activity 2, I am getting the alert perfectly. Butt when i go back to activity1 (when pressed on back button) and then return to activity2, i am…
0
votes
1 answer

java.lang.ClassCastException when trying to get background color of a button

I want when a button is clicked to get it's background color.If the background color is the same with a color in resources named "blue_color", make background transparent.Else make it "blue_color". I have tried the method mentioned here but it gives…
user7101450
0
votes
2 answers

finish background activity from broadcast receiver

I launch a new activity "ActivityB" when keypad is locked.(ActivityA has been backgrounded before the keypad is locked). ActivityB times out after 30 secs and supposed to close itself, so I called finish after 30 secs, though is not visible, after I…
Sweety Bertilla
  • 972
  • 10
  • 35
0
votes
1 answer

How to restart Background service getting killed on redmi phone For MIUM 8

I am using sticky service for background operations and its working fine in all phones even when app is closed by swiping from stack(then service is restart) but in RedMi Note 3w When app is closed by swiping from stack , service is not restarting…