Questions tagged [android-os-handler]

A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue. Each Handler instance is associated with a single thread and that thread's message queue. When you create a new Handler, it is bound to the thread / message queue of the thread that is creating it - from that point on, it will deliver messages and runnables to that message queue and execute them as they come out of the message queue.

A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue. Each Handler instance is associated with a single thread and that thread's message queue. When you create a new Handler, it is bound to the thread / message queue of the thread that is creating it - from that point on, it will deliver messages and runnables to that message queue and execute them as they come out of the message queue.

29 questions
9
votes
2 answers

Can I detect if Android has killed the application (task process) from a Notification Intent / PendingIntent?

The Android OS kills processes when it's low on memory. Scenario: Android kills the app process and I re-open it through either the Android launcher or the recent-task list (long press home button). I can check if Android killed my app process in…
4
votes
1 answer

Orientation issue in Android 7.1.1 and above

When the app is launched in landscape mode it is opening in landscape mode and switching back to portrait evethough orientation is set to portrait programatically. I suppose app should stay in portrait mode no matter in which mode you launch when…
SuReSh PaTi
  • 1,373
  • 7
  • 28
  • 46
4
votes
0 answers

binder thread pool (1 threads) starved for xxx ms

Our Android service is using a HIDL service to interact with our driver/hw but during long-runs we are seeing lot of these prints "binder thread pool (1 threads) starved for xxx ms" with 120ms < xxx > 310ms. And after sometime we are seeing the…
4
votes
2 answers

Application not installing some device Android os N android

I have samsung device s7 edge. Application not installed for live build. Please help me, what is an exactly problem. See this error throw, on Android N os in device.
4
votes
1 answer

How to close my application programmatically in android?

I need to quit my application, I have referred all the links in Stack Overflow and also on other sites, I have used finishAffinity() , finish(), System.exit(0) still I am not able to achieve it. I am overriding onBackPressed method in Main Activity…
Anish Kumar
  • 478
  • 4
  • 12
  • 27
4
votes
1 answer

java.lang.NoClassDefFoundError: android.os.AsyncTask

Weird error on Android 2.2 device . The following works in all devices and we never encountered this error until recently in GT-I5510 .Our app supports min sdk-level 8 .Clearing the app data from settings and starting the app fixed the issue but…
3
votes
0 answers

Create a Snapshot of current android device state and save it for later restore

I would like to take a snapshot of current device state (including state of apps). Just like we do for emulator. For reference check this link. https://developer.android.com/studio/run/emulator#snapshots I would like to know if it is possible for a…
2
votes
0 answers

Android: sync system volume seekbar and app seekbar

I am trying to sync the system volume seekbar with the application seekbar. System volume seekbar. App volume seekbar. I found a useful link. Taking over the volume key on Android Following, I am able to make my app seekbar change whenever users…
2
votes
2 answers

Force android app to open when it's installation complete

I'm running an android app to be the only app to run on the system, so, when boot-completed I launch the app and prevent the user from exiting it for any reason(which made me disable both navigation status bars). Then, to achieve an update to the…
Muhammed Refaat
  • 8,914
  • 14
  • 83
  • 118
2
votes
2 answers

Working Directory: null Environment:?

I am trying to run below code,I am using [1]:https://github.com/rbochet/Fast-Forward-Reboot this link. try { Runtime.getRuntime().exec( new String[] { "/system/bin/su", "-c", "reboot now" }); } catch (IOException e)…
nilesh shinde
  • 23
  • 1
  • 4
1
vote
1 answer

Device admin app for rooted android

We have our own rooted hardware device with android OS 7.0 We are building an app for that device. We have to restrict the users to performing some of the actions who will purchase that device. Here are the list of actions We want user to be…
Mubashar Rasheed
  • 77
  • 1
  • 1
  • 10
1
vote
1 answer

Creating thread in ViewRootImpl.java

I'm trying to create a thread with a looper and an handler in ViewRootImpl.java but I'm getting this error: 02-03 14:04:14.266 884 884 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean…
Pedro Maltez
  • 87
  • 1
  • 11
1
vote
1 answer

Error:(172, 25) error: BatteryManager() is not public in BatteryManager; cannot be accessed from outside package android

I am using below code and its working properly with compileSdkVersion 22 int capacityValue=new BatteryManager().getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY); but when trying to change compileSdkVersion 23 then its displaying compile…
Android dev
  • 273
  • 2
  • 5
  • 23
1
vote
0 answers

method to find if the android os is updated or not else finding the date of os installed in the device

Am working on a project where i have different functions that works based on if the device has only unupdated OS(no OS updates had happened in the device) or if the current OS is an updated version (user had updated OS in the working device). I…
1
vote
0 answers

delete dumpstate/logcat from device

I Want to delete logs generated by the device from android phone using app or any code. I tried using adb logcat -c this operation is not working until I kill ADB server(adb kill-server) and do adb logcat -c. I don't want to kill server as…
Siva
  • 1,078
  • 4
  • 18
  • 36
1
2