-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #367 from BlythMeister/MyBetaVersion
Fix for #363 change the way a media scan is triggered.
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...oid/libraries/TweetLanesCore/src/com/tweetlanes/android/core/util/SingleMediaScanner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.tweetlanes.android.core.util; | ||
|
||
import java.io.File; | ||
import android.content.Context; | ||
import android.media.MediaScannerConnection; | ||
import android.media.MediaScannerConnection.MediaScannerConnectionClient; | ||
import android.net.Uri; | ||
|
||
public class SingleMediaScanner implements MediaScannerConnectionClient { | ||
|
||
private MediaScannerConnection mMs; | ||
private File mFile; | ||
|
||
public SingleMediaScanner(Context context, File f) { | ||
mFile = f; | ||
mMs = new MediaScannerConnection(context, this); | ||
mMs.connect(); | ||
} | ||
|
||
@Override | ||
public void onMediaScannerConnected() { | ||
mMs.scanFile(mFile.getAbsolutePath(), null); | ||
} | ||
|
||
@Override | ||
public void onScanCompleted(String path, Uri uri) { | ||
mMs.disconnect(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters