Suggestions for providing user feedback for an ongoing operation - Android 3.0?
In my app I have to do lots of long-running tasks. Usually these access the network, and do som开发者_开发问答e stuff on a remote server. Obviously, these are async tasks. Now the question is: what's considered a user-friendly way to notify the user that something is happening?
I've used a solution that pops up a modal dialog with the default, indefinite, animating loading circle spinning around while the task is running. This is just terrible, the user can't interact with the app during this time - the dialog is modal - and it's damn intrusive.
What solution do you guys suggest for providing user feedback for:
A. an async task started by pushing a button on a ListView's listelement? B. an async task started by pushing a menu item? (from the ActionBar, or the regular menu, it doesn't matter)
I'd prefer the solution to be non-intrusive, but the user should notice that something is really happening.
Most apps I've seen use an indeterminate progress bar located somewhere on the UI. This way the user sees something is working, but can still interact with all other sections of the UI on the activity.
For A, I'd probably leave room in the ListView element for a progress bar. Then update the progress bar for that item.
For B, I'd think something like an ongoing notification with a progress bar would be a pretty ideal solution.
In my app I have to do lots of long-running tasks. Usually these access the network, and do some stuff on a remote server. Obviously, these are async tasks.
From the description, this might not be a case where using an AsyncTask is the right approach. What if the application's Activity that started the AsyncTask is stopped or destroyed, but the data transfer was 95% completed? Should the progress be discarded? Was the transaction atomic?
I highly recommend watching Virgil Dobjanschi's Google I/O 2010 presentation on Android REST client applications, in which he describes designing an app for handling such data and network communications. He is the author of the official Twitter app for Android.
精彩评论