[Android] Use File's getPath() and not toString() to communicate intent in saveScreenshot().
Both do the exact same thing, but one is way more indicative of intent here. Also removed an unnecessary flush. This happens upon calling .close.
This commit is contained in:
parent
c2b4f6b799
commit
6e65e8d565
|
@ -96,10 +96,9 @@ public class FileUtils {
|
|||
File dir = new File(MainActivity.home_directory);
|
||||
SimpleDateFormat s = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = s.format(new Date());
|
||||
File f = new File(dir.toString(), timestamp+".jpeg");
|
||||
File f = new File(dir.getPath(), timestamp+".jpeg");
|
||||
FileOutputStream out = new FileOutputStream(f);
|
||||
savePixels(0, 0, w, h, gl).compress(Bitmap.CompressFormat.JPEG, 100, out);
|
||||
out.flush();
|
||||
out.close();
|
||||
//attempt to put into gallery app
|
||||
MediaScannerConnection.scanFile(c.getApplicationContext(), new String[]{f.toString()}, null, new OnScanCompletedListener() {
|
||||
|
|
Loading…
Reference in New Issue