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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:54:28+00:00 2026-05-21T14:54:28+00:00

For instance, we are in SomeActivity and the activity has a button that invokes

  • 0

For instance, we are in SomeActivity and the activity has a button that invokes moving files from one dir to another (let’s call it job).

On BlackBerry I would:

  1. push a non-cancellable popup (Dialog screen) saying “Please wait…”
  2. start a thread that fulfills the job
  3. on thread completion close the popup

This approach 99.99% can guarantee that we stay on the same screen after the task is over, user just sees the popup and waits for job completion. Device rotation or whatever does not break the desired workflow.

On Android things change. I know there’s the AsyncTask that is probably provided to solve my case. There’s even a good example of how it should be used. But since there’s no guarantee of how long an Activity instance will live the AsyncTask should be cancelled on onSaveInstanceState (and restarted on onRestoreInstanceState). This means using AsyncTask there’s no guarantee we are able to fully fulfill the job once started. In some cases as sending an http post request for creating a user I would not want to get in “user already exists for this login” trouble on reruning the AsyncTask. This is possible since the AsyncTask can be interrupted while the request is already sent (and the server actually is doing its job – creating a new user), but the AsyncTask is canceled before we got the response.

Is there any solution on Android to get the BB-like behaviour stated above?

  • 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-21T14:54:29+00:00Added an answer on May 21, 2026 at 2:54 pm

    In May 2010 Google issued a new IO session called Developing Android REST client applications which explains how to achieve exactly what I asked for.

    It turned out the question is rather complicated, so there is no easy and quick solution. The solution requires deep knowledge of Android platform/API. This is the price caused by the flexibility of the app process/Activity lifecycles.

    I feel some oddity on why this info was not presented from the very first version of Android. Looks like Google knew how to write 100% bugless apps and for some marketing reason did not share the approach. Just imagine how many buggy apps was written by May 2010.

    Anyway I’m glad now I have smth we call best practice approach.

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

Sidebar

Related Questions

For instance, I have a SqlDataSource that loads a list of items. On my
Using instance methods as callbacks for event handlers changes the scope of this from
For instance I was looking at the request from a asp.net application and it
For instance, if I have a Time.now, how would I convert that to a
For instance adding new categories to a list. Once a new category has been
For instance I have a pivot table on every third worksheet that needs to
For instance, (/=[^>]/, '═') I'd like to keep that match, but only replace the
For instance, copying a configuration section from a web page and then pasting it
For instance: This is foo text for wrapping text in TextView The way that
For instance, could it be used to generate a one-time pad key? Also, what

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.