Maybe code highlighting working now?

master
Bradlee Speice 2014-04-29 23:49:33 -04:00
parent bc9fe465bc
commit 86bbdff10d
1 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ So, let's get into some actual pseudo-code!
**FetchTask.java** **FetchTask.java**
``` {% highlight java %}
class FetchTask extends AsyncTask<...> { class FetchTask extends AsyncTask<...> {
private EventBus downloadBus; private EventBus downloadBus;
public FetchTask(EventBus downloadBus) { public FetchTask(EventBus downloadBus) {
@ -54,11 +54,11 @@ class FetchTask extends AsyncTask<...> {
return results; return results;
} }
} }
``` {% endhighlight %}
**DownloadManager.java** **DownloadManager.java**
``` {% highlight java %}
class DownloadManager { class DownloadManager {
private EventBus downloadBus; private EventBus downloadBus;
private DownloadManager instance; private DownloadManager instance;
@ -75,11 +75,11 @@ class DownloadManager {
return this.downloadBus; return this.downloadBus;
} }
} }
``` {% endhighlight %}
**Fragment.java** **Fragment.java**
``` {% highlight java %}
class Fragment { class Fragment {
public void init() { public void init() {
EventBus downloadBus = DownloadManager.getInstance().getDownloadBus(); EventBus downloadBus = DownloadManager.getInstance().getDownloadBus();
@ -102,7 +102,7 @@ class Fragment {
// Initialize the UI - can safely assume we're on main thread // Initialize the UI - can safely assume we're on main thread
} }
} }
``` {% endhighlight %}
So, let's quickly review what's going on - the Fragment gets initialized, and gets the Download manager, so it can get the event bus. Then, since the AsyncTask is started alongside the new `DownloadManager`, we register that we should be notified when done. So, let's quickly review what's going on - the Fragment gets initialized, and gets the Download manager, so it can get the event bus. Then, since the AsyncTask is started alongside the new `DownloadManager`, we register that we should be notified when done.