0

I've been looking at similar questions all day, and have tried out numerous suggested functions but they don't seem to be working.

I am displaying an ImageView in an Activity, and when the user pushes a button, I want to save that ImageView in their gallery. Simple, right?

I'm new to Android so please be explicit.

Thanks

2 Answers2

0
  1. check folder permissions for KitKat write/read - your application can save images only in the folder that the app has created or in special shared permission folder for all apps. This is not valid for older android version
  2. You want to save image/picture/drawable/bitmap or ImageView? ImageView is not a picture
John BG
  • 346
  • 3
  • 10
  • Well my plan was to create a bitmap based on the content of the ImageView. Is that on the right track? And where can I find the permissions? – myLifeisanAbyss May 12 '14 at 20:06
  • After setting content to ImageView you can use the source of that content to save it as image – John BG May 12 '14 at 20:10
  • Honestly I'm going to need a little more guidance than that. I figured this would be a simple function. – myLifeisanAbyss May 12 '14 at 20:28
  • I ended up discovering that the MediaStore.Images.Media.insertImage method was returning null. I'm using the emulator, so I didn't have a photo directory yet. Taking a photo with the emulator solved this problem. – myLifeisanAbyss May 13 '14 at 13:35
0

I found the answer using android - save image into gallery.

The method suggested in the answer worked perfectly, but you have to make sure it's not returning null. It was doing that for me because I had no existing photo directories on the emulator I'm using. Taking a photo on the emulator solved it for me.

Community
  • 1
  • 1