diff options
author | Joey Grover <joeygrover@gmail.com> | 2016-05-02 09:32:39 -0400 |
---|---|---|
committer | Joey Grover <joeygrover@gmail.com> | 2016-05-02 09:32:39 -0400 |
commit | 2835258caf7f1ef2d0559368a68c82f70102e607 (patch) | |
tree | 55ad47aad9932d51ce4ef103ff0e96f2f0b1cca5 | |
parent | 15b803a676a64535fbad167d590ef604bce0569c (diff) | |
download | sdl_android-2835258caf7f1ef2d0559368a68c82f70102e607.tar.gz |
Update hello world to correct lifecycle flow
-rw-r--r-- | HelloSdl/src/com/hellosdl/sdl/SdlService.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/HelloSdl/src/com/hellosdl/sdl/SdlService.java b/HelloSdl/src/com/hellosdl/sdl/SdlService.java index 1541abca0..053d47d85 100644 --- a/HelloSdl/src/com/hellosdl/sdl/SdlService.java +++ b/HelloSdl/src/com/hellosdl/sdl/SdlService.java @@ -116,15 +116,11 @@ public class SdlService extends Service implements IProxyListenerALM{ @Override public int onStartCommand(Intent intent, int flags, int startId) { - if (intent != null) { + if(proxy == null){ startProxy(); - if(intent.hasExtra(SdlBroadcastReceiver.FORCE_TRANSPORT_CONNECTED)){ - if(proxy!=null){ - proxy.forceOnConnected(); - } - } + }else if (intent != null && intent.hasExtra(SdlBroadcastReceiver.FORCE_TRANSPORT_CONNECTED)){ + proxy.forceOnConnected(); } - return START_STICKY; } |