in my project i am using popupscreen with GaugeField for http request.Currently we are just incrementing the value of gaugefield with fixed rate and after http response we just remove the popupscreen. so some times http request is completed when gauge field is in 40% or 60%.
But i want to synchronize gaugefield value with http request/responses. it means that popupscreen will always remove at 100%.
I don’t have the code in front of me, but I something similar in a project several years ago.
I wrote a subclass of
InputStreamthat wrapped around theInputStreamobject I got back fromopenInputStream(), reimplementing all theread()methods so they would increment a counter with the number of bytes read. Whenever the counter reached a certain threshold, it would update aGaugeFieldobject that was passed into the subclass’s constructor.So your subclass would look something like this:
I’m leaving out a lot of the guts here, but I hope this sets you in the right direction.