It's actually quite easy to deal with progress reports when you let AndroidAnnotations handle thread related boilerplate code.当你使用AA操作线程相关样板代码时,处理起进度报告来确实相当简单。
Here is a simple example:下面有个简单的例子:
@EActivity
publicclassMyActivityextends Activity {
@Background
voiddoSomeStuffInBackground(){
publishProgress(0);// Do some stuff
publishProgress(10);// Do some stuff
publishProgress(100);}
@UiThread
voidpublishProgress(int progress){// Update progress views}}
Publish progressSince AndroidAnnotations 1.0Publish progress made easyIt's actually quite easy to deal with progress reports when you let AndroidAnnotations handle thread related