aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-08-11 09:13:40 -0700
committerScott Jackson <daneren2005@gmail.com>2013-08-11 09:13:40 -0700
commit21ca9cbf358e8d8c7dcf98780aa31167159e66be (patch)
tree3f0755643250e70f9d3b1d3acd4f8fbc16bc4f0a /src/github
parent3cc5dfa96f67899ada68a69b3e21816c3431b438 (diff)
downloaddsub-21ca9cbf358e8d8c7dcf98780aa31167159e66be.tar.gz
dsub-21ca9cbf358e8d8c7dcf98780aa31167159e66be.tar.bz2
dsub-21ca9cbf358e8d8c7dcf98780aa31167159e66be.zip
Just use downloadService handler to prevent startup error
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadServiceImpl.java2
-rw-r--r--src/github/daneren2005/dsub/service/JukeboxController.java5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 9568c0af..06c7495d 100644
--- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -1045,7 +1045,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
remoteState = newState;
switch(newState) {
case JUKEBOX_SERVER:
- remoteController = new JukeboxController(this);
+ remoteController = new JukeboxController(this, handler);
break;
case LOCAL: default:
break;
diff --git a/src/github/daneren2005/dsub/service/JukeboxController.java b/src/github/daneren2005/dsub/service/JukeboxController.java
index f27a147f..30160c1c 100644
--- a/src/github/daneren2005/dsub/service/JukeboxController.java
+++ b/src/github/daneren2005/dsub/service/JukeboxController.java
@@ -39,7 +39,7 @@ public class JukeboxController extends RemoteController {
private static final String TAG = JukeboxController.class.getSimpleName();
private static final long STATUS_UPDATE_INTERVAL_SECONDS = 5L;
- private final Handler handler = new Handler();
+ private final Handler handler;
private boolean running = false;
private final TaskQueue tasks = new TaskQueue();
private final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
@@ -48,8 +48,9 @@ public class JukeboxController extends RemoteController {
private RemoteStatus jukeboxStatus;
private float gain = 0.5f;
- public JukeboxController(DownloadServiceImpl downloadService) {
+ public JukeboxController(DownloadServiceImpl downloadService, Handler handler) {
this.downloadService = downloadService;
+ this.handler = handler;
new Thread() {
@Override
public void run() {