I am trying to do this thing, but not getting how? The code requests that Network Service send SMS Billing information; the Network Service's Responses are recorded when billing is succeeds or fails. Sometimes it takes long time to get the Response and I want to cancel/pause that process and re-send the request with new number.
long before = System.currentTimeMillis();
String resp = new SmsConnection().doResponseRequest(sms);
long totalResponseTime=((System.currentTimeMillis() - before )/1000);
I can only record totalResponseTime
and sometime it takes 50-100 seconds to get the response from Service. Is there any way where I can say
"If resp
is taking more than 15 seconds cancel/pause this Request and re-send another at the same time. After we receive the response we will process that request."
I need something like a TimeOut Option for receiving the response. Please suggest.
Thanks,