forked from mirror/monocles_chat
Scan files so they show up under images (Cheogram)
This commit is contained in:
parent
ba9c63b6e8
commit
1d0cdab857
1 changed files with 14 additions and 0 deletions
|
@ -14,6 +14,7 @@ import android.provider.DocumentsContract;
|
|||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
import android.media.MediaScannerConnection;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
|
@ -96,6 +97,19 @@ public class DownloadDefaultStickers extends Service {
|
|||
mDatabaseBackend.saveCid(cid, file, sticker.getString("url"));
|
||||
}
|
||||
|
||||
MediaScannerConnection.scanFile(
|
||||
getBaseContext(),
|
||||
new String[] { file.getAbsolutePath() },
|
||||
null,
|
||||
new MediaScannerConnection.MediaScannerConnectionClient() {
|
||||
@Override
|
||||
public void onMediaScannerConnected() {}
|
||||
|
||||
@Override
|
||||
public void onScanCompleted(String path, Uri uri) {}
|
||||
}
|
||||
);
|
||||
|
||||
try {
|
||||
File copyright = new File(mStickerDir.getAbsolutePath() + "/" + sticker.getString("pack") + "/copyright.txt");
|
||||
OutputStreamWriter w = new OutputStreamWriter(new FileOutputStream(copyright, true), "utf-8");
|
||||
|
|
Loading…
Reference in a new issue