multithreading - Block thread while uploading picture to Amazon S3 on Android -
is there way block current thread , wait while picture uploaded s3? my code uploading s3 running in android service in doinbackground() method (with other network calls have in specific order), it's off main ui thread. want know when uploading done, can dismiss notification , show user uploaded/done. i'm using sdk v2, this: transferutility transferutility = new transferutility(s3, ctx); transferobserver obs = transferutility.upload( s3bucketnamephototest, imageid + ".jpg", file, new objectmetadata()); obs.settransferlistener(new uploadlistener(dbhandler, ctx, imageid)); where uploadlistener class implementing transferlistener, in onstatechanged() method can detect when upload finished: public void onstatechanged(int id, transferstate state) { if (state == transferstate.completed) { //do here! } } that's not need, because service call long done when onstatechange() callback fires. but loo...