Catch errors in list view

Start progress indicator on ui thread
pull/189/head
Alex Baker 12 years ago
parent f5339735f3
commit 072d573a60

@ -5,8 +5,13 @@ import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ListView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ErrorCatchingListView extends ListView {
private static final Logger log = LoggerFactory.getLogger(ErrorCatchingListView.class);
public ErrorCatchingListView(Context context) {
super(context);
}
@ -24,6 +29,7 @@ public class ErrorCatchingListView extends ListView {
try {
return super.onTouchEvent(ev);
} catch (Exception e) {
log.error(e.getMessage(), e);
return true;
}
}

@ -27,6 +27,12 @@ public class IndeterminateProgressBarSyncResultCallback implements SyncResultCal
@Override
public void started() {
activity.setProgressBarIndeterminateVisibility(true);
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
activity.setProgressBarIndeterminateVisibility(true);
}
});
}
}

Loading…
Cancel
Save