Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pulce committed Jan 1, 2015
1 parent 074e145 commit 15b8a6d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/com/windnow/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ private void initiateDl(Station st) {
stAda.notifyDataSetChanged();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
new DownloadStation(st).executeOnExecutor(
AsyncTask.THREAD_POOL_EXECUTOR, st.getUrl());
AsyncTask.THREAD_POOL_EXECUTOR);
} else {
new DownloadStation(st).execute(st.getUrl());
new DownloadStation(st).execute();
}
}

Expand All @@ -162,15 +162,15 @@ private void initiateDl(Station st) {
* AsyncTask to download the content...
*
*/
private class DownloadStation extends AsyncTask<String, Integer, String> {
private class DownloadStation extends AsyncTask<Void, Integer, Void> {
private Station station;

private DownloadStation(Station station) {
this.station = station;
}

@Override
protected String doInBackground(String... urls) {
protected Void doInBackground(Void... v) {
try {
if (station.getType() == Station.PIC) {
DownloadStations.downloadPic(station);
Expand All @@ -186,12 +186,11 @@ protected String doInBackground(String... urls) {
station.setSecLine(getString(R.string.download_error));
LoadSaveOps.printErrorToLog(e);
}
return "";

return null;
}

@Override
protected void onPostExecute(String result) {
protected void onPostExecute(Void v) {
stAda.notifyDataSetChanged();
}
}
Expand Down

0 comments on commit 15b8a6d

Please sign in to comment.