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
12
votes
3 answers

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/app/ActivityManagerCompat

Description I want to build todolist app.I want to store information using RoomDatabse. I build Database with room and get infomation than save to database. But when i click add button then i got exception. I have searched for an appropriate…
Rabbi hasan
  • 340
  • 1
  • 5
  • 14
9
votes
3 answers

Android - restore last viewed Activity

I have 3 different Activities that user navigates between in no particular order. My goal it twofold: When user switches to something else when app is resumed I want to start where user left even if app was terminated When last activity is resumed…
Bostone
  • 36,858
  • 39
  • 167
  • 227
6
votes
6 answers

Android checking whether the app is closed

I have an android application i need one function or any broadcast receiver that can check if the app is closed.. i don't need to call on destroy in every activity (there is about 20 activity into the app) i tried to add this function in Application…
6
votes
1 answer

Can someone explain ActivityManager: Start proc 27854 (class)/u0a66 for service?

Can someone please explain what is: ActivityManager? 27854? u0a66?
Red M
  • 2,609
  • 3
  • 30
  • 50
5
votes
0 answers

Why do android kills the client process which holds the cursor on content provider on another process in this case?

My app runs in Process1 and I'm using a content provider provided by another app which runs under Process2. When Process2 kills it's causing my app which runs under Process1 to be killed. 09-14 23:31:52.583 782 1351 I ActivityManager: Killing…
4
votes
1 answer

Attempt to read from field 'int com.android.server.wm.Task.mTaskId' on a null object reference

I am getting below exception in my firebase crashlytics console. Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'int com.android.server.wm.Task.mTaskId' on a null object reference at…
Raj008
  • 3,539
  • 2
  • 28
  • 26
4
votes
1 answer

AOSP ActivityManager not running

I'm trying to port Android 7.0 into a customized HW platform and have zygote running background. But when I tried to start an app by using am start <>, it gives error "Can't connect to activity manager; is system running?". After that I did service…
georgewhr
  • 174
  • 1
  • 12
3
votes
2 answers

SingleTask activity is created multiple times within the same process

I have a launcher app which has a singleTask activity as the main entry point. When the user navigates away to another activity or to a 3rd party app and then hits the home button, then this activity should be brought to the front. However what I…
2
votes
0 answers

Why does ActivityManager.runningAppProcesses returns current running app, only?

On my AndroidTV Emulator I have: val am = this.getSystemService(ACTIVITY_SERVICE) as ActivityManager am.runningAppProcesses?.forEach { Logger.debug("XXX", "Running ${it.uid} , ${it.processName}, ${it.pid}") } I also start other 3rd party apps,…
Mr.T
  • 72
  • 6
2
votes
1 answer

How to prevent ActivityManager from killing my application's background process

I am developing a mobile application that runs in the background. It takes screenshots in the background on an interval, however after some time, ActivityManager would kill the process with the log, I/ActivityManager: killing com.example: excessive…
2
votes
1 answer

Field requires API level 29 (current min is 16): android.app.TaskInfo#topActivity

I tried to check whether activity is in foreground or background, so I used activity manager to find that. When my compileSdkVersion is 28 the app is compiled successfully. When I run the same code with compileSdkVersion 29, I get below error, The…
Pavithra
  • 31
  • 1
  • 5
2
votes
1 answer

close the started activity in my case

I have a class which doesn't extend Activity or Fragment. It is a independent class. I would like to use that class to control an Activity start and finish. public class MyActivityManager() { public MyActivityManager(Context context) { …
Leem
  • 17,220
  • 36
  • 109
  • 159
1
vote
1 answer

How can I track the ActivityManager loading time of my app?

I would like to track how much time take my app to start, but I would like to track this specific info defined here: https://developer.android.com/topic/performance/vitals/launch-time In order to have better graphics about it and add custom info to…
1
vote
2 answers

How to view the Back Stack programmatically?

I'm trying to create an app ("ShowStack") to view the current App Back Stack (for development purposes). I know it can be done by using adb with the command "adb shell dumpsys activity activities". I tried using ActivityManager functions…
DontPanic
  • 2,164
  • 5
  • 29
  • 56
1
vote
1 answer

"CANNOT LINK EXECUTABLE" error with QPython (Android)

I'm trying to build a simple Telegram bot to start and stop an old Samsung device working as a security cam. All is good via ssh, so the commands involved have been already proved to be working. It's now a matter of moving them to QPython and the…
dentex
  • 3,223
  • 4
  • 28
  • 47
1
2 3