문제

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

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.

다른 팁

  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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top