android - Deleted picture still visible in gallery -


I have a small problem.

In my application, I have a picture gallery to the user. I save the path before doing something else when the user wants the picture, then I want to copy it to another folder, and then remove it from the original one.

Well, it works, the original photo is removed, and a copy appears in another folder. Buuut It's still there The deleted photo can still be seen in the gallery, and the copy can not be seen. When I call Gdx.files.absolute (original text) .exists () wrong, and gives Gdx.files.external (copyPath). Axis () returns this truth, and I can work with a copy of the picture with no problem.

It looks like the gallery is not updated.

I use it to remove and copy an image:

  Public Zero HTTokfolder () {if (DoesOriginalPathExist ()) {ifCopyExist (! )) {System.out.println ("Copy"); Gdx.files.external ("/ customfolder /" + filename) .write (gdx file. BSLUIT (file path). Reed (true); } System.out.println ("delete"); Gdx.files.absolute (filepath) .delete (); }}  

Full path of the original photo and file name file name ("picture.jpg") in the FilePath gallery < / P>

When I discovered something during my research, when the media clears the data of the storage application, the right gallery is visible after a while, with unopplied photos and copies of copies.

In addition, I have the WRITE_EXTERNAL_STORAGE permission.

Do you guys know what's wrong?

found the solution.

I had to update the gallery with this function:

  Public Zero UpdateGallery (string filepath) {sendBroadcast (new intent (Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile (new file (FilePath))); }  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -