Questions tagged [activity-manager]

manages all of the top-level components (activities, receivers, services, content providers) running in them.

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.

133 questions
1
vote
0 answers

Whitespace in custom args on Android instrument test run

I have this instrumented test suite in Android, that I would like to pass some custom arguments to. I've been using this format, as stated in the official documentation: adb shell am instrument -w -e key value -e class…
arvere
  • 727
  • 1
  • 7
  • 21
1
vote
0 answers

How attach Tag intent extra for NFC-Tag scan simulation through ADB shell?

I am trying to execute adb shell am start -W -a android.nfc.action.NDEF_DISCOVERED -d "https://www.google.de" in a way that would be similar to an actual NFC-Tag scan which has some URI (SmartPoster). This is necessary, as the above command works…
Jook
  • 4,564
  • 3
  • 26
  • 53
1
vote
0 answers

For Android Lock Task Mode is activityManager.lockTaskModeState always "LOCK_TASK_MODE_NONE"

I'm following the developer guide for Lock Task Mode. It's clear for the most part, but I think needs a bit of work in some areas. It seems to provide instructions on the presumption that you're starting another activity, though it does mention…
Chucky
  • 1,701
  • 7
  • 28
  • 62
1
vote
1 answer

How to get Activity Waiting Time from ActivityManager on app launching?

I'm using ADB to show Waiting Time Activity on launching app, the command I used is : adb shell am start -S -W com.example.app/.MainActicity -c android.intent.category.LAUNCHER -a android.intent.action.MAIN here's the result : So, my question is…
1
vote
0 answers

Activity Manager can't find my Service - why?

I have a service which returns START_STICKY on #onStartCommand() and it is being started in my MainActivity's #onCreate() method. When i close my app, Service is being destroyed and it starts itself again. However, when it starts itself,…
melianor
  • 170
  • 2
  • 10
1
vote
0 answers

How to get all visible running applications package names?

I have a custom launcher which is always visible and it starts 3 different apps. Starting from Android N on each app icon click (on the custom launcher) I must check whether any of the 3 applications is currently running. If no app is running, the…
1
vote
1 answer

How can I go back to the previous activity, without finishing my current activity

Basically, I have an activity which contains the code for a Video conferencing app. And I need to keep that in the background. So that when the user presses a button, I create a FloatingViewService, and send from my activity, the data to that…
1
vote
0 answers

getAppTask returning empty list in Android

I'm trying to get my app's task info with answered mentioned here- ActivityManager.getRunningTasks is deprecated android I'm not able to figure out any issue. Can anyone help on this? Any permission I need to add?
AndroDev
  • 3,236
  • 8
  • 35
  • 49
1
vote
0 answers

Get task id by package name or process id

I have package name and PID of other running apps, but i want to get task id of those apps. My target android os is 6 and i can not use activityManger.getRecentTasks(). Have any idea?
coder
  • 3,195
  • 2
  • 19
  • 28
1
vote
0 answers

Why activity manager is returning one recent app on android phone but all on genymotion?

I looked into some code to get the recent apps in my phone. it is working fine on genymotion but not on android phone.here is the code. package com.example.abdul.myapplication; import java.util.List; import android.app.ActivityManager; import…
Abdul Rehman
  • 133
  • 12
1
vote
1 answer

How to use ActivityManager.setWatchHeapLimit() to watch heap_limit

According to the official document: https://developer.android.com/reference/android/app/ActivityManager.html#setWatchHeapLimit(long) I wrote a demo to see whether the HEAP_LIMIT would be triggered.But seems that it was not working,and here is my…
MichaelYe
  • 386
  • 4
  • 15
1
vote
2 answers

How can I kill other foreground activity in android?

I want to kill OTHER(NOT ITSELF) foreground activity/service. I checked some methods about kill application. ActivityManager.restartPackage(String packageName) It was deprecated since android 2.2. So I can't use this…
1
vote
4 answers

After notification button return to original activity

I wrote an app, that brings up a notification every certain time via an alarmIntent. The user clicks on the notification and gets into an activity. After doing something in this activity he should press a button to return to the original app he was…
Natjo
  • 2,005
  • 29
  • 75
1
vote
0 answers

ALL RUNNING SERVICES (explanatory)

I have tried to find a nice explanation about some unsuspected result in getRunningServices. This is a simple code to get a complete list of all running SERVICES: ActivityManager actvityManager = (ActivityManager)…
nnyerges
  • 563
  • 4
  • 15
1
vote
0 answers

Running am start command synchronously

When I run, adb shell am start -n com.android.gallery3d/.app.MovieActivity -d /sdcard/1.mp4 the control immediately terminates by printing, Starting: Intent { dat=/sdcard/1.mp4 flg=0x80000 cmp=com.android.gallery3d/.app.MovieActivity } Is there a…
1 2 3
8 9