Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Publish progress

pyricau edited this page Jan 10, 2012 · 3 revisions

Since AndroidAnnotations 1.0

Publish progress made easy

It's actually quite easy to deal with progress reports when you let AndroidAnnotations handle thread related boilerplate code.

Here is a simple example:

@EActivity
public class MyActivity extends Activity {

  @Background
  void doSomeStuffInBackground() {
    publishProgress(0);
    // Do some stuff
    publishProgress(10);
    // Do some stuff
    publishProgress(100);
  }

  @UiThread
  void publishProgress(int progress) {
    // Update progress views
  }

}

Using AndroidAnnotations

Questions?

Enjoying AndroidAnnotations

Improving AndroidAnnotations

Extending AndroidAnnotations

Clone this wiki locally