diff options
author | Mike Beattie <mike@ethernal.org> | 2012-08-28 22:08:49 +1200 |
---|---|---|
committer | Mike Beattie <mike@ethernal.org> | 2012-08-28 22:08:49 +1200 |
commit | ea5fe9e95a888d623329d17d048ee360ea114ad1 (patch) | |
tree | e782a2cc019579ccb097220d0f848cfd86791699 | |
parent | c6d667a6ac0decfde5bc8a180b14774e9942dd0c (diff) |
altosdroid: move methods around
Signed-off-by: Mike Beattie <mike@ethernal.org>
-rw-r--r-- | altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java index e3e6012e..8e63f630 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java @@ -139,6 +139,30 @@ public class AltosDroid extends Activity { }; + void doBindService() { + bindService(new Intent(this, TelemetryService.class), mConnection, Context.BIND_AUTO_CREATE); + mIsBound = true; + } + + void doUnbindService() { + if (mIsBound) { + // If we have received the service, and hence registered with it, then now is the time to unregister. + if (mService != null) { + try { + Message msg = Message.obtain(null, TelemetryService.MSG_UNREGISTER_CLIENT); + msg.replyTo = mMessenger; + mService.send(msg); + } catch (RemoteException e) { + // There is nothing special we need to do if the service has crashed. + } + } + // Detach our existing connection. + unbindService(mConnection); + mIsBound = false; + } + } + + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -286,28 +310,4 @@ public class AltosDroid extends Activity { return false; } - - void doBindService() { - bindService(new Intent(this, TelemetryService.class), mConnection, Context.BIND_AUTO_CREATE); - mIsBound = true; - } - - void doUnbindService() { - if (mIsBound) { - // If we have received the service, and hence registered with it, then now is the time to unregister. - if (mService != null) { - try { - Message msg = Message.obtain(null, TelemetryService.MSG_UNREGISTER_CLIENT); - msg.replyTo = mMessenger; - mService.send(msg); - } catch (RemoteException e) { - // There is nothing special we need to do if the service has crashed. - } - } - // Detach our existing connection. - unbindService(mConnection); - mIsBound = false; - } - } - } |