summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Grover <joeygrover@gmail.com>2016-05-02 09:32:39 -0400
committerJoey Grover <joeygrover@gmail.com>2016-05-02 09:32:39 -0400
commit2835258caf7f1ef2d0559368a68c82f70102e607 (patch)
tree55ad47aad9932d51ce4ef103ff0e96f2f0b1cca5
parent15b803a676a64535fbad167d590ef604bce0569c (diff)
downloadsdl_android-2835258caf7f1ef2d0559368a68c82f70102e607.tar.gz
Update hello world to correct lifecycle flow
-rw-r--r--HelloSdl/src/com/hellosdl/sdl/SdlService.java10
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;
}