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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:14:58+00:00 2026-05-21T15:14:58+00:00

Currently I use an Activity to upload an image to the web, I’m using

  • 0

Currently I use an Activity to upload an image to the web, I’m using AsyncTask and everything is working great. I currently use an Activity to achieve this, basically the activity allows the user to enter a few details, take a picture and then submit, a progress dialog is displayed until a response is received. When on E or G connections the whole process can be quite lengthy (in excess of a minute). Its not possible to finish the activity and return to the previous activity (which is what I want) until a response is received.

What options do I have. Currently if I press the home button the process works fine and continues to upload, can the application be minimized programmability? . I see many problems with this approach, for example if the activity closes or an error occurs.

The only approach I can think of is to move the actual upload code to a service, gather the information using the activity and allow the activity to start a new service for each upload? I can then notify the user of success or failure using the NotificationManager and handle the re-try in the service.

I noticed that when sharing an image from the gallery to Facebook the activity immediately closes and the user receives feedback via a notification. I’m assuming this approach uses a service to upload the image to Facebook?

Any help / advice would be much appreciated.

Regards

  • 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-21T15:14:59+00:00Added an answer on May 21, 2026 at 3:14 pm

    I suggest you to use the following setup:

    1. Use your activity to prepare (configure/setup) what the user wants to do (for example, choose the picture he wants to upload and the destination folder)
    2. When the user presses “Send”, invoke a service that will do the uploading task. I’ll note some advantages of this later)
    3. When the service finishes, create a notification to display the results. You should use an OnGoingNotification so the user knows that the file is being uploaded (it can have a progress indicator too)

    Using a service instead of an Activity has some advantages. For example, you don’t have to worry with configuration changes (like changing the orientation of the device), you don’t “lock” the user in an activity where they have nothing to do, etc.

    Uploading doesn’t require a UI so using an activity isn’t the best way to do it.

    In short: use a service

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

Sidebar

Related Questions

I currently use my local web server to allow costumers to preview some applications
We currently use VSS 6, this is not going to change I am afraid.
We currently use LoadRunner for performance testing our web apps, but we also have
Consider the following use case. Activity 1 starts Activity 2. Activity 2 is currently
I currently use nant, ccnet (cruise control), svn, mbunit. I use msbuild to do
I currently use a DataTable to get results from a database which I can
I currently use subversion for my version control via AhnkSVN and Visual Studio. I
I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason
We currently use a hand-rolled setup and configuration script and a hand-rolled continuous integration
I currently use the following command, but it's a little unwieldy to type. What's

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.