import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
-import android.media.MediaScannerConnection;
-import android.media.MediaScannerConnection.OnScanCompletedListener;
-import android.net.Uri;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
public void onReceive(Context context, Intent intent) {
String accountName = intent.getStringExtra(FileDownloader.ACCOUNT_NAME);
String downloadedRemotePath = intent.getStringExtra(FileDownloader.EXTRA_REMOTE_PATH);
-
-
-
if (getAccount().name.equals(accountName) &&
downloadedRemotePath != null) {
boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);
//boolean isOffscreen = Math.abs((mViewPager.getCurrentItem() - position)) <= mViewPager.getOffscreenPageLimit();
- if (downloadWasFine){
- // Trigger Mediascan
- MediaScannerConnection.scanFile(
- context,
- new String[]{file.getStoragePath()},
- null,null);
- }
-
if (position >= 0 && intent.getAction().equals(FileDownloader.getDownloadFinishMessage())) {
if (downloadWasFine) {
mPreviewImagePagerAdapter.updateFile(position, file);