diff options
Diffstat (limited to 'same-android/src/main/java/com/orbekk/SameControllerActivity.java')
-rw-r--r-- | same-android/src/main/java/com/orbekk/SameControllerActivity.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/same-android/src/main/java/com/orbekk/SameControllerActivity.java b/same-android/src/main/java/com/orbekk/SameControllerActivity.java index c8c1ebd..a2d5688 100644 --- a/same-android/src/main/java/com/orbekk/SameControllerActivity.java +++ b/same-android/src/main/java/com/orbekk/SameControllerActivity.java @@ -115,14 +115,14 @@ public class SameControllerActivity extends Activity { setContentView(R.layout.controller); showIpAddress(); - - Intent intent = new Intent(this, SameService.class); - bindService(intent, sameConnection, Context.BIND_AUTO_CREATE); } @Override public void onStart() { super.onResume(); + Intent intent = new Intent(this, SameService.class); + bindService(intent, sameConnection, Context.BIND_AUTO_CREATE); + IntentFilter sameServiceUpdates = new IntentFilter( SameService.AVAILABLE_NETWORKS_UPDATE); registerReceiver(broadcastReceiver, sameServiceUpdates); @@ -133,6 +133,7 @@ public class SameControllerActivity extends Activity { if (sameService != null) { unbindService(sameConnection); } + unregisterReceiver(broadcastReceiver); } @Override |