File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
restcomm.android.client.sdk/src/main/java/org/mobicents/restcomm/android/client/sdk Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,17 @@ public void shutdown() {
268268
269269 if (DeviceImpl .isInitialized ()) {
270270 DeviceImpl .GetInstance ().Unregister ();
271- DeviceImpl .GetInstance ().Shutdown ();
271+ // allow for the unregister to be serviced before we shut down the stack (delay 2 secs)
272+ // TODO: a better way to do this would be to wait for the response to the unregistration
273+ // before we shutdown
274+ Handler mainHandler = new Handler (RCClient .getContext ().getMainLooper ());
275+ Runnable myRunnable = new Runnable () {
276+ @ Override
277+ public void run () {
278+ DeviceImpl .GetInstance ().Shutdown ();
279+ }
280+ };
281+ mainHandler .postDelayed (myRunnable , 2000 );
272282 }
273283 state = DeviceState .OFFLINE ;
274284 }
You can’t perform that action at this time.
0 commit comments