How to store and retrieve bitmap in sharedPreferences in Android?

前端 未结 4 1512
遥遥无期
遥遥无期 2020-12-03 18:14

I am new in Android. I want to store my bitmap in sharedPreferences. Can anyone tell me how it will possible? Actually my requirements is, I fetch the image from gallery as

4条回答
  •  没有蜡笔的小新
    2020-12-03 18:31

    Don't store bitmaps in a sharedpreference. If you need to persist it during the lifetime of your application, you can assign it to a static field. If you want to persist it even across device reboots, put it in a file or on the database.

    For more information, read http://developer.android.com/resources/faq/framework.html#3

提交回复
热议问题