简体   繁体   中英

Android Camera App - Have to Remount SD Card?

I am working on an app that uses the camera to take a picture and stores that picture on the SD Card. The problem is that after I take a save a picture, I have to unmount and remount the SD Card before I can see the picture in the Gallery app.

Should I unmount and remount the SD Card via my app, every time the user takes a picture? Is there a better solution to this?

You can't mount/unmount the SD card (external storage) from an app. You probably need to call media scanner to get your picture indexed. Look at here and here for pointers. There is also an sample app that comes with the SDK. BTW, what Android version are you testing on?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM