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

  • SEARCH
  • Home
  • 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 7046773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:41:25+00:00 2026-05-28T02:41:25+00:00

I am trying to build a task killer type of app in android. I

  • 0

I am trying to build a task killer type of app in android. I can show the list of currently running task using ActivityManager but facing problem in killing the task.

Here is what i am doing to get the list of currently running task :

ActivityManager am = (ActivityManager) context.
            getSystemService(Activity.ACTIVITY_SERVICE);
List<RunningTaskInfo> a = am.getRunningTasks(Integer.MAX_VALUE);

PackageManager pack = this.getPackageManager();

for(int i = 0; i < a.size(); i++) {
    String packageName = a.get(i).topActivity.getPackageName();
    Drawable d = null;
    String appName = "";

    try {
        d = pack.getApplicationIcon(packageName);
        appName = (String)pack.getApplicationLabel(pack.getApplicationInfo(packageName,PackageManager.GET_META_DATA));
    } catch (NameNotFoundException e) {
        e.printStackTrace();
    }
    
    packName.add(packageName);  //arraylist of package name
    apps.add(appName);          // arraylist of app name
    icons.add(d);               //arraylist of icons
}

It worked for me But now as I am trying to kill the task using killBackgroundProcesses :

am.killBackgroundProcesses(package name);

It did not work . Also killBackgroundProcesses method is available in API level 2.2 then how can i perform the same task in previous API level such as 1.6 etc.

Is there any other way to show the currently active apps and kill them?

  • 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-05-28T02:41:26+00:00Added an answer on May 28, 2026 at 2:41 am

    No one can kill process except Android OS itself.

    Most of the task killer in android market don’t kill the app they just restart the process

    by using

    public void restartPackage (String packageName)
    

    when this method is called by your activity the operating system immediately called

    savedInstanceState and save the state of that activity you want to kill. Now this process is

    removed from memory and OS saved it state.Now when next time user start that activity it

    will start from where it was killed or in other words restarted. You can verify it from any

    task manager that they don’t kill the process because no one can do so. This method also

    work in ICS.

    for above method you can look at here . As far as i know killBackgroundProcesses (String packageName) is for API 8 and above.

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

Sidebar

Related Questions

I've been trying to build a task list in Android, and I want it
I'm trying to write an MSBuild task to build a database using FluentNhibernate mappings.
I'm trying build an App Engine connected Android application and am having some problems
Im trying to run launch4j as a build task on macosx but im getting
I'm currently learning d3.js, and as a task I am trying to build a
I'm trying to build a Django app for a translation crowdsourcing task. For each
I am trying to build a calendar app for Android. I am struck in
I was trying Build For Archiving application (from Titanium Mobile) with xCode 4.4, but
I'm trying build a MVC framework, but I'm confused about manage themes. Well... I
I am trying to build a distributed task queue, and I am wondering if

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.