Questions tagged [screen-off]

58 questions
0
votes
0 answers

Why my BroadcastReceiver receives the intent "android.intent.action.SCREEN_OFF" multiple time however i performed only SCREEN_OFF one time?

I have an android service Running. In this service, i have a BroadcastReceiver which is registred within the intentFilter : filter.addAction(Intent.ACTION_SCREEN_OFF); filter.addAction(Intent.ACTION_SCREEN_ON); I make the registration in the…
0
votes
1 answer

Android - ANR Broadcast of Intent { act=android.intent.action.SCREEN_OFF }

I'm getting ANR on this method private byte[] getByteArrayFromBitmap(Bitmap bitmap) { if (bitmap == null) { return null; } ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); …
0
votes
1 answer

How to use SendMessage in C# to turn off the monitor on Windows 11 Modern Standby

I have in the past, used SendMessage(handle, 0x112, 0xF170, 2); to turn off the monitor leaving the machine on. It works great until Modern Standby came along and screwed everything up. The above now makes the entire computer go into sleep mode (S0…
Seth
  • 1,769
  • 4
  • 26
  • 39
0
votes
0 answers

How to recognize touch gesture when screen is turned off

I have a Oneplus 6 and it has this super cool functionality wherein I can draw certain gestures on the turned off screen and it opens up apps and other stuff. For example: drawing a circle switches on the flashlight, drawing an S opens the camera…
0
votes
1 answer

Android activity onKeyDown() not triggered for Power button, and Intent.ACTION_SCREEN_OFF is not broadcasted either

I have an Activity (Activity_RingAlarm) that is supposed to be launched as a full-screen intent when an alarm rings. The activity is launched fine, no issue there. I want to give the user an option to dismiss the alarm by pressing the power button.…
Wrichik Basu
  • 1,005
  • 17
  • 28
0
votes
1 answer

UWP app temporary stops when screen is off

I have made a very simple Windows 10 UWP app. The only thing it does is printing date and time to a textblock every second. It look like this: 12-05-2021 19:42:50 12-05-2021 19:42:51 12-05-2021 19:42:52 12-05-2021 19:42:53 This work fine when the…
DeeJay
  • 5
  • 2
0
votes
0 answers

My Service is idling when the device goes into power saving mode

I'm currently struggling to keep my service alive when trying to get information about the user for a study. We are using a foreground service, which runs a timer on a 5-sec interval checking a resource of the user. As that resource is only relevant…
Yukko
  • 23
  • 5
0
votes
1 answer

Calling "setterm -blank 10" on a schedule (configuring how long to wait before screens is turned off automatically)

I've GNU/linux Debian 10 (sid) net install with no x11 on a HP Pavilion dv6. I can keep the monitor on alway with: setterm -blank 0 Then have the monitor shut off after 10 minutes of inactivity with the: setterm -blank 10. What I would like to do…
0
votes
1 answer

Android BroadcastReceiver Before Screen Off

Android Broadcast Receiver: Is there any trick/event that can trigger just before screen is going to Off android.intent.action.SCREEN_OFF OR Any way to know if screen goes off by power press or by auto sleep function?
Wasim A.
  • 9,660
  • 22
  • 90
  • 120
0
votes
1 answer

Android make the application autorun after unlocking the screen even if the application is not running

I'm trying to create an autorun service: so that the application launches every time after unlocking the screen, after entering the graphic key or password if it exists (on Android 7,8,9,10). I wrote the code dynamically through the borocast…
0
votes
1 answer

How to prevent phone from going to idle mode

I've developed an application that streams music (via internet connection) using service and having trubles streaming content without phone going idle. While i was developing my application each time i tried case mentioned below the music was…
luka cagalj
  • 15
  • 1
  • 7
0
votes
0 answers

Why is OnStop called when the screen turns off

I have an android app which is pretty old now. It's built via the android SDK via ant. The app starts with a screen and connects to a bluetooth device. The apps does a wake lock to keep CPU and the user presses power to turn screen off. The app…
user1667016
  • 123
  • 2
  • 8
0
votes
1 answer

Turning off the screen in android

Hi, for a project I'm working on I have to turn off the screen of the android device. After searching on here I came to use this code: public static final int REQUEST_ADMIN_ENABLE = 12345; ComponentName dPAComponent; DevicePolicyManager…
0
votes
4 answers

Android in service how to know when screen is locked?

I want to handle an Androids application work in the background. I've read that I have to use services for this. In this application, I need to know when the screen gets locked and when it gets unlocked again. Every time this happens, I have to do…
Simone
  • 29
  • 1
  • 7
0
votes
1 answer

how to detect if screen is locked if KeyGuard is not set - Android?

I want to know if screen is locked or not, when the SCREEN_OFF is broadcasted while user doesn't set KeyGuard?
Ahmed Mostafa
  • 918
  • 1
  • 12
  • 20