Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7912929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:43:29+00:00 2026-06-03T13:43:29+00:00

Im working on a simple task manager that would allow user to kill running

  • 0

Im working on a simple task manager that would allow user to kill running processes and terminate applications. Im getting a running processes list using:

List<RunningAppProcessInfo> procInfo = activityManager.getRunningAppProcesses();

With one click of a button I want to kill all running processes that arent important or essencial in any way. For this, Im using:

ArrayList<String> packages = new ArrayList<String>();
for (int i = 0; i < procInfo.size(); i++) {
    String process = procInfo.get(i).processName;
    if (!packages.contains(process)) {
            packages.add(process);
    }
}

This will get me names of all running processes and now I should probably filter them somehow using their importance code:

int importance = procInfo.get(i).importance

But Im not really sure how. What should I keep running and what is safe to kill? Im using

applicationManager.killBackgroundProcesses(process);

to kill my process. My next question is, is this the best way to kill a process? Because when I do it like this and than I open again one of the applications for which all processes were killed, I find myself not in its Main Activity but right there where I left it, so I asume that the application was never terminated even though all its processes were killed. Also, I fint that application in quite a desolate state (ImageViews and Buttons are missing, TextViews arent where theyre supposed to be). Note that this application is also written by myself and normally it works perfectly fine.

My last question is, when this problem with killing processes is solved, I want also to terminate selected applications. How do I get the list of running applications? I was thinking getting a list of running processes and than somehow get applications from that list. After that, terminating a selected application by killing all its processes. But I dont think thats the best way since it obviously didnt work when I killed all processes.

Thank you for any reply!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:43:30+00:00Added an answer on June 3, 2026 at 1:43 pm

    Killing apps in Android is usually considered a bad idea. This is because the Android OS is designed to handle all Task Management. Usually when an item is listed as running on the Android OS, it is not even consuming resources. If the system does need more resources, it will close the application down properly. If an application is not closed properly, ie by a task killer it can have many bad side effects.

    Also, just because an app is “running” doesn’t mean that it has a process running. If you look at the documentation for ActivityManager it says this.

    Information you can retrieve about a particular task that is currently “running” in the system. Note that a running task does not mean the given task actually has a process it is actively running in; it simply means that the user has gone to it and never closed it, but currently the system may have killed its process and is only holding on to its last state in order to restart it when the user returns

    killBackgroundProcesses() kills a process like the Android OS would (when it needs more memory), so it is likely that it is retaining its last state because it thinks that it was killed because the system needed more resources. Thus leading the system to believe that there is a chance the user may want to return to the application (why it keeps its last state).

    Anyways, after you have read the above and still wish to write a task killer, you may find it beneficial to check out the open source task killer. The code can be seen here: http://code.google.com/p/freetaskmanager/source/browse/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a simple app that has the following requirement: a task will
I'm working on a small piece of ksh code for a simple task. I
The simple working query, list the number of licenses for each license type: Query:
I am working on a background program that will be running for a long
I made a simple Task Manager using local.storage and I'm using console.log to set
Working on a simple C program I'm stuck with an if test: int line_number
Working on a simple TimeTracker App. You start a timer, wait a certain time,
im working on a simple C++ HTTP server as a school project and I
im working on a simple game like space invaders,and i got into a problem.
I am working on a simple protocol stack for a small embedded system (multidrop,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.