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() {
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
@Override
- public void onDestroy() {
- super.onDestroy();
+ public void onStop() {
+ super.onStop();
if (mDownloadConnection != null) {
unbindService(mDownloadConnection);
mDownloadConnection = null;
@Override
+ public void onDestroy() {
+ super.onDestroy();
+ }
+
+
+ @Override
public boolean onOptionsItemSelected(MenuItem item) {
boolean returnValue = false;
}
}
- @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.
*