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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:59:34+00:00 2026-05-26T07:59:34+00:00

I have a background service BGService , it displays an Activity BGServActivity when certain

  • 0

I have a background service BGService , it displays an Activity BGServActivity when certain event occurs. I have override onBackPressed to finish the displayed Activity BGServActivity.

Suppose, UI of Application App_XYZ is currently displaying. And my service BGService is triggered by the event and BGServActivity is displayed. And When i press back it closes the current Activity BGServActivity and displays the previous UI from Application App_XYZ .

But i want the UI from App_XYZ to be sent to background when i start BGServActivity from my BGService.

My question is

Is there any special flag or something that i can do to send the previously displaying UI from another activity to sent to background before starting My BGServActivity from My service BGService.

  • 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-26T07:59:34+00:00Added an answer on May 26, 2026 at 7:59 am

    If you want to force the user to go to the Home screen when your Activity closes, you can do this:

    Intent intent = new Intent(Intent.ACTION_MAIN);
    intent.addCategory(Intent.CATEGORY_HOME);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);
    

    I advise against this though. The standard behavior when closing an activity should be to return to the previously viewed activity.

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

Sidebar

Related Questions

I have an Activity communicating with and directly accessing a background Service's data members
I have a simple main activity with 3 buttons, and a background service that
I have a background thread that handles communication with an external service. Each time
Background I have made a Web Service in Visual Studio, and I'm trying to
Background: I have a WCF service deployed on my local machine that in turns
For background, I have a Data layer and Service layer loosely based on Rob
I have a background Service which must run permanently. The service just has to
Using android 2.3.3, I have a background Service which has a socket connection. There's
Hi. I have create a background service application following this tutorial http://androidsourcecode.blogspot.com/2010/10/basic-android-background-service.html . But
I have a background service running which sends out emails to users of my

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.