|
@@ -54,7 +54,7 @@ import okhttp3.ResponseBody;
|
|
*/
|
|
*/
|
|
public class MyFileUtils {
|
|
public class MyFileUtils {
|
|
private static final String TAG = "FileUtil";
|
|
private static final String TAG = "FileUtil";
|
|
- private static final String filesDirectory = getCacheDir(Utils.getApp())+ File.separator+"cooleshow";
|
|
|
|
|
|
+ private static final String filesDirectory = getCacheDir(Utils.getApp()) + File.separator + "cooleshow";
|
|
public static final String examDownloadDirectory = "examDownload";
|
|
public static final String examDownloadDirectory = "examDownload";
|
|
|
|
|
|
public static final String MP3_FILE_SUFFIX = ".mp3";
|
|
public static final String MP3_FILE_SUFFIX = ".mp3";
|
|
@@ -1073,10 +1073,10 @@ public class MyFileUtils {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public static String getFilePath(Bitmap bitmap) {
|
|
|
|
|
|
+ public static String getFilePath(Context context, Bitmap bitmap) {
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
bitmap.compress(Bitmap.CompressFormat.PNG, 80, baos);
|
|
bitmap.compress(Bitmap.CompressFormat.PNG, 80, baos);
|
|
- String path = Environment.getExternalStorageDirectory() + "/dayaWhiteBroad";
|
|
|
|
|
|
+ String path = getCacheDir(context, "dayaWhiteBroad");
|
|
File dir = new File(path);
|
|
File dir = new File(path);
|
|
if (!dir.exists()) {
|
|
if (!dir.exists()) {
|
|
dir.mkdirs();
|
|
dir.mkdirs();
|