X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/a139eca1260913a08eac5e8e167bb8b8a385e532..c407a568e09de0c13c9a42fcd3e4662e38744cb2:/src/com/owncloud/android/files/services/FileDownloader.java diff --git a/src/com/owncloud/android/files/services/FileDownloader.java b/src/com/owncloud/android/files/services/FileDownloader.java index 7a031359..b525bc4a 100644 --- a/src/com/owncloud/android/files/services/FileDownloader.java +++ b/src/com/owncloud/android/files/services/FileDownloader.java @@ -494,29 +494,28 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis mDownloadClient = null; // grant that future retries on the same account will get the fresh credentials } else { - Intent showDetailsIntent = null; - if (downloadResult.isSuccess()) { - if (PreviewImageFragment.canBePreviewed(download.getFile())) { - showDetailsIntent = new Intent(this, PreviewImageActivity.class); - } else { - showDetailsIntent = new Intent(this, FileDisplayActivity.class); - } - showDetailsIntent.putExtra(FileActivity.EXTRA_FILE, download.getFile()); - showDetailsIntent.putExtra(FileActivity.EXTRA_ACCOUNT, download.getAccount()); - showDetailsIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - - } else { - // TODO put something smart in showDetailsIntent - showDetailsIntent = new Intent(); - } + // TODO put something smart in showDetailsIntent + Intent showDetailsIntent = new Intent(); mNotificationBuilder .setContentIntent(PendingIntent.getActivity( this, (int) System.currentTimeMillis(), showDetailsIntent, 0)); } mNotificationBuilder.setContentText(ErrorMessageAdapter.getErrorCauseMessage(downloadResult, download, getResources())); - mNotificationManager.notify(tickerId, mNotificationBuilder.build()); + + // Remove success notification + if (downloadResult.isSuccess()) { + // Sleep 2 seconds, so show the notification before remove it + Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + public void run() { + mNotificationManager.cancel(R.string.downloader_download_succeeded_ticker); + } + }, 2000); + + } + } }