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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:20:49+00:00 2026-06-08T17:20:49+00:00

I know how to put any application in the foreground but I would now

  • 0

I know how to put any application in the foreground but I would now put any application in the background. Ie, each application i want.
I searched a lot on google but I have not found a solution.
Have you any idea how?
I tried to display the home but it does not work :

Intent i = new Intent(Intent.ACTION_MAIN);
i.addCategory(Intent.CATEGORY_HOME);
startActivity(i);

Thank you very much in advance.

Here is my all code (its a test code), i launch map app and i want just after, puting it in backgroud:

    List<ResolveInfo> pkgAppsList =  retreivedAllApplicationsInstalled();      

    ActivityManager actMngr = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
    List<RunningAppProcessInfo> runningAppProcesses = actMngr.getRunningAppProcesses();
    for (RunningAppProcessInfo pi : runningAppProcesses) {

        String[] testPklist = pi.pkgList;

        if(pi.importance == RunningAppProcessInfo.IMPORTANCE_BACKGROUND){
            for(String tp : testPklist){
                if(tp.equals("com.google.android.apps.maps")){

                       //launch map application
                       Intent i = new Intent(Intent.ACTION_MAIN);
                       PackageManager manager = getPackageManager();
                       i = manager.getLaunchIntentForPackage("com.google.android.apps.maps");
                       i.addCategory(Intent.CATEGORY_LAUNCHER);
                       startActivity(i);

                }
            }

        }

    }
    //try to put back all applications on displaying home
    Intent back = new Intent(Intent.ACTION_MAIN);
    back.addCategory(Intent.CATEGORY_HOME);
    startActivity(back);
  • 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-08T17:20:49+00:00Added an answer on June 8, 2026 at 5:20 pm

    If you want your app to run in the background you should use something called a Service. You can find more information on the link. But remember that background process drain battery, so use it with care.

    Hope that helps.

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

Sidebar

Related Questions

The question is confusing, I know, but I just couldn't put it any other
I developed an iphone application , But i need to put google Adsense in
I dont't know how to put that, but I need y coordinates of the
I want to know if really 'put' has succeeded in putting the file to
I'm starting in the Rails world and i want to know how to put
I'm building a backbone.js application, and don't quite know where to put my templates.
I know that I should put all the html elements in body tag, but
I have a strange observation that in any web application designing, why we need
I need to use log4j in my application, but I don't know how I
I have a C application and I want to include a Scripting Language to

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.