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

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

Loading…
Cancel
Save