~singpolyma/cheogram-android

f07f871fbb6674f860b422dea36a42ea923be117 — Stephen Paul Weber 1 year, 3 months ago 5e30b21
Scan files so they show up under images
1 files changed, 14 insertions(+), 0 deletions(-)

M src/cheogram/java/com/cheogram/android/DownloadDefaultStickers.java
M src/cheogram/java/com/cheogram/android/DownloadDefaultStickers.java => src/cheogram/java/com/cheogram/android/DownloadDefaultStickers.java +14 -0
@@ 7,6 7,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.Intent;
import android.database.Cursor;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Environment;
import android.os.IBinder;


@@ 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");