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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:55:55+00:00 2026-06-12T13:55:55+00:00

Just wondering if I could gather some constructive comments. Well, I am developing a

  • 0

Just wondering if I could gather some constructive comments. Well, I am developing a tabbed application with activity group for each tab and related child activities. One of the activities handles a file downloader- waits for the download link from the server, once received download begins in the background. On completion, the file (mostly PDF) opens up in a generic viewer. This part works exceptionally well.

Now, coming to app requirement, I want the activity to run in background. When the user is in the download page, it shows a progress dialog with necessary messages. User, having decided to switch to other screens, moves to other screens. In real, the downloader activity should run in background.

A typical download activity class looks like:

 public class DownloadActivity extends Activity {
    public void onCreate(Bundle state) { //code here}
    public void onPause() {//can anything be done here?}
    public boolean onKeyUp(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
           //go back to previous screens to check other features
           TabGroupActivity parentActivity = (TabGroupActivity)getParent();
           //onBackPressed()- current activity is killed and new one is created
           parentActivity.onBackPressed();
           return true;
        }
        return super.onKeyUp(keyCode, event);
    }
 }

I want to modify the above activity to help it work background while user plays arounds with other screen.

Any thoughts?

Hope it is not very confusing! Let me know in case you don’t understand any of the above.

Thanks in advance!

  • 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-12T13:55:56+00:00Added an answer on June 12, 2026 at 1:55 pm

    Activity can’t and shouldn’t work in background. For background operations in Android you should use Service.

    There is an article about Android processes and services.

    Service doesn’t have UI, it should do all the job, in the background. Activity can display current application state(s) to the user, that is changed/modified by Service. When Service finish his work, it could send a Notification, for example. More details in this guide.

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

Sidebar

Related Questions

Just wondering if you could help wanting to produce an activity stream in Java,
Just wondering if someone could shed some light on a problem I'm having. The
I was just wondering where I could find some language-agnostic tutorials for what lambda
I was just wondering if someone could shed some light on why I am
I was just wondering if I could remove some redundancy for a help function
I was just wondering if someone could give me some guidance on the best
Hi sorry still learning here and slow to learning code arguments. Just wondering could
Just wondering if someone could help me with a very simple SQL query. I
Just wondering if someone could point me in the right direction of how to
I just wondering how I could replace the second instance of a string inside

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.