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 7743753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:36:56+00:00 2026-06-01T09:36:56+00:00

I am developing a task manager application.. In that app, I display to the

  • 0

I am developing a task manager application..

In that app, I display to the user a list of running apps and kill button beside each app.
When user presses kill button the corresponding activity will be killed and i used

      activitymanager.killbackgroundprocesses(packageName)

I created another application called service notification where user can start and stop a service by clicking on button “start service” and button “stop service” respectively.. Then before running my task manager app, i started the service from service notification app.
So this activity was displayed in my task manager app.

But when i kill that activity, it disappears from the list and then appears again because the service is restarting..How do I kill the sevice then?

I used startService and onCreate for starting service and showing some notification and stopService and onDestroy for stopping service…

  • 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-01T09:36:58+00:00Added an answer on June 1, 2026 at 9:36 am

    I finally found an answer to my question…

    After using

    activitymanager.killbackgroundprocesses(packageName) , 
    

    we have to check if there are any services running under that package name or process name.

    Then we have to use

    stopService(new Intent().setComponent(serviceInfos.get(i).service))
    

    But it would return an error because android does not allow us to stop another service

    So I used these two lines in the manifest and then ran my app in the build machine

    coreApp="true" 
    android:sharedUserId="android.uid.system"
    

    These two lines are there in the android settings manifest file, which allows settings to stop service if the user wants.

    So the activity got killed along with the service… 🙂

    And remember this worked only on the build machine….

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

Sidebar

Related Questions

In the app that I'm developing, I want to have re-occuring task on each
I am developing an application suite that consists of several applications which user can
I'm developing an outlook addin that has a button in a custom task pane
i am developing an application that gathers a list with all the files of
I'm developing an app that needs background task updating location every 30 mins. I've
I was thinking about developing an app that enables the user to remotely check
I'm developing a custom MSBuild task that builds an ORM layer , and using
I'm developing an app where I use performSelectorInBackground to do some sync task in
I'm developing add-on based application. Every add-on use scheduler. Loaded add-on schedule task. My
A web application I am developing needs to perform tasks that are too long

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.