Not back on main thread when query.runAsync completes

15 views
Skip to first unread message

macs.d...@gmail.com

unread,
Jul 17, 2015, 7:03:41 AM7/17/15
to mobile-c...@googlegroups.com
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
               
}
             
}
       
});


Reply all
Reply to author
Forward
0 new messages