Skip to content Skip to sidebar Skip to footer

Adding Pictures To The Gallery - Android

I have an activity that takes a photo with the camera, and then adds it to its proper folder (in this case /DCIM/Camera). But then when you exit the app and load up the Android gal

Solution 1:

You need to run the MediaScanner with the path of the newly added photo. Will show up in the library then. API Level 8 has a convenient function for this called scanFile.

Details at http://developer.android.com/reference/android/media/MediaScannerConnection.html

Solution 2:

Select "Dev Tools" from the Apps screen, the select "Media Scanner" (or "Media Provider" in newer versions of Android) to get the emulator to recognize the files so they would be displayed in the Media Gallery. Pls mark the ans as correct if you think it resolved your issue. tnks :)

Post a Comment for "Adding Pictures To The Gallery - Android"