Showing
3 changed files
with
11 additions
and
5 deletions
@@ -155,9 +155,14 @@ public class PrintingJob extends PrintDocumentAdapter { | @@ -155,9 +155,14 @@ public class PrintingJob extends PrintDocumentAdapter { | ||
155 | assert name != null; | 155 | assert name != null; |
156 | 156 | ||
157 | try { | 157 | try { |
158 | - final File externalFilesDirectory = | ||
159 | - context.getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS); | ||
160 | - File shareFile = new File(externalFilesDirectory, name); | 158 | + final File shareDirectory = new File(context.getCacheDir(), "share"); |
159 | + if (!shareDirectory.exists()) { | ||
160 | + if (!shareDirectory.mkdirs()) { | ||
161 | + throw new IOException("Unable to create cache directory"); | ||
162 | + } | ||
163 | + } | ||
164 | + | ||
165 | + File shareFile = new File(shareDirectory, name); | ||
161 | 166 | ||
162 | FileOutputStream stream = new FileOutputStream(shareFile); | 167 | FileOutputStream stream = new FileOutputStream(shareFile); |
163 | stream.write(data); | 168 | stream.write(data); |
-
Please register or login to post a comment