Skip to content Skip to sidebar Skip to footer

Pictures Wont Save On Samsung Nexus

I have a Problem. I start from my own Application the Build-In Photoapplication with a Photo-Intent. String photoName = System.currentTimeMillis() + '.jpg'; File

Solution 1:

Make sure you offer the new file to be scanned:

MediaScannerConnection.scanFile(this,
          newString[] { file.toString() }, null,
          newMediaScannerConnection.OnScanCompletedListener() {
      publicvoidonScanCompleted(String path, Uri uri) {
          // code to execute when scanning is complete
      }
 });

You can pass in a null argument for the OnScanCompletedListener if you don't need to be notified when the scanner has picked it up, but you might want to at least put a logging statement there.

Solution 2:

It works fine now, the problem was that I create the File by my self, with:

Filefile=newFile(..); 

But you have to use:

ContentValues values=new ContentValues();
values.put(MediaStore.Images.Media.TITLE, "IMG_"+timeStamp+.jpg"); 

And put it into the intent to save the file at once without restarting the phone.

Post a Comment for "Pictures Wont Save On Samsung Nexus"