Hi i am using couchbase mobile 1.1 on android and i am getting an CalledFromWrongThreadException when i try to update the ui within query.runAsync's completed callback. I assumed that when a async task completes that i am back on the main threat.
It seems runAsync works differently, however, i am not able to find much in the docs about it. advice would be very much appreciated (better stick to good old AsyncTask here?)
query.runAsync(new QueryCompleteListener() {
@Override
public void completed(QueryEnumerator result, Throwable error) {
if (error != null) {
ui.update(result); //throws exception
}
}
});