How to take an image from gallery and keep orientation (portrait / landscape) on android [duplicate]

3

I have an app that takes images from the android gallery, but on some devices the image orientation changes, I'd like to know how to keep the original orientation of the image.

    
asked by anonymous 28.09.2015 / 22:59

1 answer

1

When a new project is created, a file called AndroidManifest.xml is usually generated, in which you can configure the screen orientation of each created activity, among other settings. Basically what you need to do is put in each "activity "the android code: screenOrientation=" portrait ", which it leaves the screen in portrait mode. Here is an example code:

<activity
            android:name=".Inicio"
            android:label="@string/app_name"
            android:screenOrientation="portrait">
    
16.12.2015 / 14:42