Questions tagged [android-activitymanager]

Using the Activity Manager, the Android System manages a stack of activities which are in different states (starting, running, paused, stopped, destroyed).

Actually the Activity Manager does more than manage activities. It was named that because in the very early implementations of Android all we had were activities (before we had even implemented multiple processes yet), but in the ultimate implementation the activity manager would probably be better called the "application manager" -- it decides when to start processes, and manages all of the top-level components (activities, receivers, services, content providers) running in them.

34 questions
1
vote
0 answers

Standard API to find the current Activity in foreground and the focused view in it

So I have this Bluetooth device which pairs with a regular Android device and sends out some form of Bluetooth commands. Basically it sends out a long byte sequence which is then encoded to a regular string and displayed on currently focused…
1
vote
0 answers

Android: get active app names in active session

I've tried to get all names of applications which the user opened in a session (session start with unlocking phone and ends with turning off the screen). As first I've tried to get the current app in the foreground. I use a service in the background…
Dennis
  • 77
  • 6
1
vote
1 answer

How to retrieve app usage statistics of an android device?

I'm constantly trying new apps and my phone is getting cluttered with old apps, I no longer use. So, I thought I'd develop a simple app to help me out. There are similar apps, but none does exactly what I want: I would like to have a list of apps…
0
votes
0 answers

Android Usage Events: APP_RESUMED twice

I am using the UsageEvents API to calculate daily foreground time of installed apps on an Android device https://developer.android.com/reference/android/app/usage/UsageEvents.Event What I am doing is ordering the events by time for each activity and…
0
votes
1 answer

Does Android Activity embedding support custom split?

Does Android Activity embedding support custom split like one of these two? 1) 2)
0
votes
1 answer

How can I clear activity stack and start only one activity?

I launched next activity with these flags to clear the backstack. addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) and also tried with addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK) I've…
c-an
  • 3,543
  • 5
  • 35
  • 82
0
votes
1 answer

How to check if the Android application is running in foreground, in background, or is killed? (API level 27+)

I have this code snippet in my Android application, that checks if the app is killed or not. static boolean isAppKilled(Context appContext) { boolean appProcessRunning = false; ActivityManager activityManager = (ActivityManager)…
0
votes
0 answers

Can Android kill Fragment without killing activity that hosts it?

First of all I’d like to sorry if my question is dummy, I’m just starting my Android way and wasn’t able to find the answer to my question in google . I’d like to know whether Android os is able to kill only fragment(support fragment) without…
0
votes
0 answers

Retrieving stack trace of launch intent

I have a React Native app running on Android and using some libraries that I have recently added. Now the app is constantly reopening itself after a couple of seconds whenever I close it without completely killing it via the back stack. Logcat is…
nexus
  • 150
  • 3
  • 13
0
votes
1 answer

isActivityStartAllowedOnDisplay() method

I'm trying to launch a second activity on a secondary display. This works fine on the emulators, but I need the secondary display to handle touch events. With Android Pie, launching an activity on some second displays would throw a security…
Karringgton
  • 207
  • 1
  • 3
  • 11
0
votes
1 answer

Android APIs for background application statistics?

I'm new to Android development and I'd like to develop an app that shows application statistics, but only for their background runs (with background i mean the app is totally closed, also in the multitasking, and it starts to run for doing different…
0
votes
1 answer

Detect current foreground android application

I would like to write an android service that checks every 5 seconds for the foreground application currently running e.g. if the user is currently using Chrome, it should give me Chrome as the running app. When the user switches to Google Maps, it…
DSPNewbie
  • 33
  • 5
0
votes
0 answers

What does "system_process E/ActivityManager: Empty Process Limit hit" mean?

Android version: JellyBean (4.3) We recently hit the above mentioned error message Empty Process Limit hit thrown by the ActivityManager. A search on Google with this string didn't result in any answer and/or explanation. I also had a look into the…
GeertVc
  • 1,914
  • 17
  • 22
0
votes
0 answers

How to listen to running processes?

I want an application that is not in my phone to be checked for the name and to send the toast message accordingly. For example ; I have the Twitter app on my phone, but the ABC app is not on my phone. By entering a value in the string, the…
matchs
  • 31
  • 6
0
votes
1 answer

Emulate an app interaction with adb

I really want to find an adb command to start an app and emulate/fake some clicks in the app. When make an logcat and do with my android-remote what I want to emulate, I find many different lines like: I/ActivityManager( 1920): START u0…
JustASec
  • 1
  • 1