mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 08:18:00 +01:00
pass context instead of whole activity to scanFile
This commit is contained in:
parent
34158c217c
commit
d643cc2822
3 changed files with 4 additions and 4 deletions
|
@ -356,7 +356,7 @@ public class MainActivity extends SimpleActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
final String[] deletedPaths = updatedFiles.toArray(new String[updatedFiles.size()]);
|
final String[] deletedPaths = updatedFiles.toArray(new String[updatedFiles.size()]);
|
||||||
MediaScannerConnection.scanFile(this, deletedPaths, null, null);
|
MediaScannerConnection.scanFile(getApplicationContext(), deletedPaths, null, null);
|
||||||
mToBeDeleted.clear();
|
mToBeDeleted.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ public class MediaActivity extends SimpleActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
final String[] deletedPaths = mToBeDeleted.toArray(new String[mToBeDeleted.size()]);
|
final String[] deletedPaths = mToBeDeleted.toArray(new String[mToBeDeleted.size()]);
|
||||||
MediaScannerConnection.scanFile(this, deletedPaths, null, new MediaScannerConnection.OnScanCompletedListener() {
|
MediaScannerConnection.scanFile(getApplicationContext(), deletedPaths, null, new MediaScannerConnection.OnScanCompletedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onScanCompleted(String path, Uri uri) {
|
public void onScanCompleted(String path, Uri uri) {
|
||||||
if (mMedia != null && mMedia.isEmpty()) {
|
if (mMedia != null && mMedia.isEmpty()) {
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class ViewPagerActivity extends SimpleActivity
|
||||||
mBeingDeleted = "";
|
mBeingDeleted = "";
|
||||||
hideSystemUI();
|
hideSystemUI();
|
||||||
|
|
||||||
MediaScannerConnection.scanFile(this, new String[]{mPath}, null, null);
|
MediaScannerConnection.scanFile(getApplicationContext(), new String[]{mPath}, null, null);
|
||||||
addUndoMargin();
|
addUndoMargin();
|
||||||
mDirectory = new File(mPath).getParent();
|
mDirectory = new File(mPath).getParent();
|
||||||
mMedia = getMedia();
|
mMedia = getMedia();
|
||||||
|
@ -256,7 +256,7 @@ public class ViewPagerActivity extends SimpleActivity
|
||||||
if (file.delete()) {
|
if (file.delete()) {
|
||||||
mBeingDeleted = mToBeDeleted;
|
mBeingDeleted = mToBeDeleted;
|
||||||
final String[] deletedPath = new String[]{mToBeDeleted};
|
final String[] deletedPath = new String[]{mToBeDeleted};
|
||||||
MediaScannerConnection.scanFile(this, deletedPath, null, new MediaScannerConnection.OnScanCompletedListener() {
|
MediaScannerConnection.scanFile(getApplicationContext(), deletedPath, null, new MediaScannerConnection.OnScanCompletedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onScanCompleted(String path, Uri uri) {
|
public void onScanCompleted(String path, Uri uri) {
|
||||||
scanCompleted();
|
scanCompleted();
|
||||||
|
|
Loading…
Reference in a new issue