diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-01-26 17:29:37 +0100 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-01-26 17:29:37 +0100 |
commit | d11cd76a7f64262424687421a1d78496dde356fe (patch) | |
tree | 6cc81e899f50afe0b55e6037c98cfa260167a7ac /same-android/src/main/java | |
parent | c2c1e4c5aad74a7fbca5c281f9d8ea2d0ba99ad3 (diff) |
Rename DiscoveryService => SameService.
Diffstat (limited to 'same-android/src/main/java')
-rw-r--r-- | same-android/src/main/java/com/orbekk/discovery/SameService.java (renamed from same-android/src/main/java/com/orbekk/discovery/DiscoveryService.java) | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/same-android/src/main/java/com/orbekk/discovery/DiscoveryService.java b/same-android/src/main/java/com/orbekk/discovery/SameService.java index e9aac5f..149b882 100644 --- a/same-android/src/main/java/com/orbekk/discovery/DiscoveryService.java +++ b/same-android/src/main/java/com/orbekk/discovery/SameService.java @@ -12,15 +12,15 @@ import android.widget.Toast; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class DiscoveryService extends Service { +public class SameService extends Service { private Logger logger = LoggerFactory.getLogger(getClass()); - private Thread thread = null; + private Thread discoveryThread = null; public final class DiscoveryThread extends Thread { Broadcast broadcast; public DiscoveryThread() { - broadcast = new Broadcast(DiscoveryService.this); + broadcast = new Broadcast(SameService.this); } @Override public void run() { @@ -42,7 +42,7 @@ public class DiscoveryService extends Service { private Handler toastHandler = new Handler() { @Override public void handleMessage(Message message) { - Toast.makeText(DiscoveryService.this, + Toast.makeText(SameService.this, (String)message.obj, Toast.LENGTH_SHORT) .show(); logger.info("Display toast: {}", (String)message.obj); @@ -58,10 +58,10 @@ public class DiscoveryService extends Service { public int onStartCommand(Intent intent, int flags, int startId) { Toast.makeText(this, "service start: " + intent.getAction(), Toast.LENGTH_SHORT).show(); - if (thread == null) { + if (discoveryThread == null) { synchronized (this) { - thread = new DiscoveryThread(); - thread.start(); + discoveryThread = new DiscoveryThread(); + discoveryThread.start(); } } return START_STICKY; @@ -70,7 +70,7 @@ public class DiscoveryService extends Service { @Override public void onDestroy() { Toast.makeText(this, "service stopped", Toast.LENGTH_SHORT).show(); - thread.interrupt(); + discoveryThread.interrupt(); } } |