X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/86cec34b2534b770d9e07700c6b64ebea1c1296f..a0e4e7ea97d5686b29a4e778fcab688f8c4f1bc8:/src/com/owncloud/android/ui/preview/PreviewImageActivity.java diff --git a/src/com/owncloud/android/ui/preview/PreviewImageActivity.java b/src/com/owncloud/android/ui/preview/PreviewImageActivity.java index f797580d..62dc8cf6 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageActivity.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageActivity.java @@ -116,11 +116,6 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi createViewPager(); - mDownloadConnection = new PreviewImageServiceConnection(); - bindService(new Intent(this, FileDownloader.class), mDownloadConnection, Context.BIND_AUTO_CREATE); - mUploadConnection = new PreviewImageServiceConnection(); - bindService(new Intent(this, FileUploader.class), mUploadConnection, Context.BIND_AUTO_CREATE); - } private void createViewPager() { @@ -143,6 +138,10 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi public void onStart() { super.onStart(); Log.e(TAG, "PREVIEW ACTIVITY ON START"); + mDownloadConnection = new PreviewImageServiceConnection(); + bindService(new Intent(this, FileDownloader.class), mDownloadConnection, Context.BIND_AUTO_CREATE); + mUploadConnection = new PreviewImageServiceConnection(); + bindService(new Intent(this, FileUploader.class), mUploadConnection, Context.BIND_AUTO_CREATE); } @Override @@ -190,8 +189,8 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi @Override - public void onDestroy() { - super.onDestroy(); + public void onStop() { + super.onStop(); if (mDownloadConnection != null) { unbindService(mDownloadConnection); mDownloadConnection = null; @@ -204,6 +203,12 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi @Override + public void onDestroy() { + super.onDestroy(); + } + + + @Override public boolean onOptionsItemSelected(MenuItem item) { boolean returnValue = false; @@ -323,23 +328,6 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi } } - @Override - public void notifySuccessfulDownload(OCFile file, Intent intent, boolean success) { - /* - if (success) { - if (mWaitingToPreview != null && mWaitingToPreview.equals(file)) { - mWaitingToPreview = null; - int position = mViewPager.getCurrentItem(); - mPreviewImagePagerAdapter.updateFile(position, file); - Log.e(TAG, "BEFORE NOTIFY DATA SET CHANGED"); - mPreviewImagePagerAdapter.notifyDataSetChanged(); - Log.e(TAG, "AFTER NOTIFY DATA SET CHANGED"); - } - } - */ - } - - /** * This method will be invoked when a new page becomes selected. Animation is not necessarily complete. *