inconsistancy in writing image to hardware in android -
I'm having a problem I'm trying to create a bitmap in a directory on your phone, though it does not always work Does and does not work right at any time. If I run to see in the directory it wont get, I often do not see it at all before it shows up in the other folder, to keep Bella around and refresh. I do not understand, no help or would be much appreciated insight, thanks
ByteArrayOutputStream bytes = new ByteArrayOutputStream (); MyImage.compress (bitmap.compress format.png, 40, bytes); try {File f = new File (Environment.getExternalStorageDirectory () + '/ myDirectory / "+" test.png "); f.createNewFile (); FileOutputStream fo = new FileOutputStream (f); fo.write (bytes.toByteArray ( )); fo.close ();} catch (Aioi Akspshn e) {log. a (tag, "was unable to copy the image" + Ikstosting ());}
< / div> no one comes due over this with a similar problem to that, then I discovered the solution. as long as I USB cable The phone does not disconnect, so long as the file is for any reason Ikhai will not. The second I identifies the file.
Comments
Post a Comment