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
0
votes
1 answer

How to know my android app is running in the receiver?

I try wrote some code to get SMS and when the SMS come from special number do something. I define a receiver to my app then i used below code to determine if app is running go ahead otherwise show a notification. ActivityManager activityManager =…
Majid
  • 519
  • 1
  • 9
  • 21
0
votes
0 answers

How to find the home press button in android L

Hi in my code I'm trying to catch the home Button click in android i'm using this code for capture the home button click public boolean isApplicationSentToBackgroundAbove(final Context context) { ActivityManager am = (ActivityManager)…
Jagan
  • 692
  • 1
  • 12
  • 38
0
votes
0 answers

Wrong output of ActivityManager.getRunningAppProcesses?

I'm trying to check if the specific process is running by using getRunningAppProcesses inside of BroadcastReceiver.onReceive(Context context, Intent intent). But when that specific application is completely closed method getRunningAppProcesses tells…
mirt
  • 1,453
  • 1
  • 17
  • 35
0
votes
1 answer

Tracing From Activity.java to ActivityManagerServices

I'm trying to trace registerReceiver() from Activity class to understand the process flow. I'll believe the call will end up in ActivityManagerService.registerReceiver(). From my understanding, it should be involve a request to SystemService, since…
cperdana
  • 37
  • 7
0
votes
0 answers

Use a service to start an Activity when another App is launched

I'm trying to make a service which opens up an activity or some kind of window, when it detects that a new App - which is not on the whitelist - was launched. This way I want to prevent people from getting to an App like the Browser, which they cant…
user4063693
0
votes
1 answer

Android get second activity from activity stacks

I have three activity running into application. FirstActivity.java SecondActivity.java ThirdActivity.java NOw, I am using SINGLE_TASK so all activities are in stacks. The placing of activities is like. FirstActivity.java (Top) SecondActivity.java…
0
votes
0 answers

Application crash without any error

I have 2 classes phone and dialpad.java. In phone class i have 5 lines when u click on these lines the dialpad.java class will open.i want to run multiActivities in a single Tab like i have home tab and in home tab the phone activity is show when i…
0
votes
1 answer

Find if a process belongs to a foreground app vs a background service in Android

I wanted to know if a process in Android belongs to an app which the user is actively controlling vs if it is a background service which runs without user interaction? Since I'm talking about process, I'm currently trying to get the data from the…
0
votes
1 answer

Do we have option to get activity time information from Activity manager

Do we have option to get activity time information (how long the activity is visible like that) from Activity manager I would like to get the time information for other apps activity, running in the same device. The below code is return as the list…
0
votes
1 answer

Android adb am profile enlarged buffer size

does somebody know how to enlarge the buffer size for the "am profile" command? Or is it even possible to enlarge the buffer size using command line? I know it is possible with the Debug.startMethodTracing(), but I need it for the "am profile"…
simon
  • 1
  • 1
0
votes
0 answers

How to show alert in any one of running activities of third party app by service

How can i show alert in any one of running activities of third party app by initializing service (finds and show alert) in mainactivity of third party app and it needs to show my alert in one activity. Please look at this i think we can do using…
0
votes
1 answer

Unable to use ActivityManager inside Countdown timer in a Service

I have a Service in which I am using a CountDownTimer. Issue is that - inside the onTick(...) function of the CountDownTimer class, I need to use ActivityManager am = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE); Problem is that I get…
user1406716
  • 9,565
  • 22
  • 96
  • 151
0
votes
1 answer

How to close third party apps by my own app on Android

I'm working in app to monitoring how much long a child can play a game in a Android device. I know how to get a list of runnings apps using: List tasks = activityManager.getRunningTasks(1);//Integer.MAX_VALUE Now I want a way to…
leonvian
  • 4,719
  • 2
  • 26
  • 31
0
votes
0 answers

Check if user has browsed out from android application

Code for checking if user is browsed out from application: public boolean isApplicationSentToBackground(final Context context) { try { ActivityManager am = (ActivityManager) context …
0
votes
0 answers

Launcher restart by system

on android platform, I kill an application(for example Launcher) at shell by command: kill -9 pid, the proccess is killed. then after a second , the apk be restarted. Anyone know which module restart the apk? where is the code? Note: I debug…
Tony
  • 57
  • 1
  • 5
1 2 3
8
9