From: David A. Velasco Date: Wed, 22 Jan 2014 17:39:34 +0000 (+0100) Subject: Fixed wrong index to substring X-Git-Tag: oc-android-1.5.5~69^2~3 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/1a3f202ac83f4f8868ee619b45b935f78c00f20b?ds=inline;hp=--cc Fixed wrong index to substring --- 1a3f202ac83f4f8868ee619b45b935f78c00f20b diff --git a/src/com/owncloud/android/files/services/FileDownloader.java b/src/com/owncloud/android/files/services/FileDownloader.java index 05f99e07..064b703e 100644 --- a/src/com/owncloud/android/files/services/FileDownloader.java +++ b/src/com/owncloud/android/files/services/FileDownloader.java @@ -435,7 +435,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis int percent = (int)(100.0*((double)totalTransferredSoFar)/((double)totalToTransfer)); if (percent != mLastPercent) { mNotification.contentView.setProgressBar(R.id.status_progress, 100, percent, totalToTransfer < 0); - String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR + 1)); + String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR) + 1); String text = String.format(getString(R.string.downloader_download_in_progress_content), percent, fileName); mNotification.contentView.setTextViewText(R.id.status_text, text); mNotificationManager.notify(R.string.downloader_download_in_progress_ticker, mNotification); diff --git a/src/com/owncloud/android/files/services/FileUploader.java b/src/com/owncloud/android/files/services/FileUploader.java index a55ce8cc..f05f0846 100644 --- a/src/com/owncloud/android/files/services/FileUploader.java +++ b/src/com/owncloud/android/files/services/FileUploader.java @@ -705,7 +705,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe int percent = (int) (100.0 * ((double) totalTransferredSoFar) / ((double) totalToTransfer)); if (percent != mLastPercent) { mNotification.contentView.setProgressBar(R.id.status_progress, 100, percent, false); - String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR + 1)); + String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR) + 1); String text = String.format(getString(R.string.uploader_upload_in_progress_content), percent, fileName); mNotification.contentView.setTextViewText(R.id.status_text, text); mNotificationManager.notify(R.string.uploader_upload_in_progress_ticker, mNotification);