2013-12-16 13:23
99人阅读
收藏
举报
AndroidAnnotation
Publish progress
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.当你使用AA操作线程相关样板代码时,处理起进度报告来确实相当简单。
Here is a simple example:下面有个简单的例子:
@EActivity
public class MyActivity extends Activity {
@Backgroundvoid doSomeStuffInBackground() {
publishProgress(0);// Do some stuffpublishProgress(10);// Do some stuffpublishProgress(100);}@UiThreadvoid publishProgress(int progress) {
// Update progress views}}