Question

Please tell me:

  1. How to save the camera image into "sharedpreferences"?

  2. After opening the camera and take picture, When I return back to the previous activity, I found the screen is displayed horizontally and it does not return back to it's actual orientation. How can I fix this problem?

Regards

Was it helpful?

Solution

You can not save binary data into SharedPreferences. You could serialize your image into a string value and store it into SharedPreferences but this is not what preferences are intended for.

You will be better off saving the image into the database.

As for the screen orientation take a look at this question: How to make an application ignore screen orientation change?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top