How to grab an image from the gallery and maintain orientation (portrait/landscape) on android

Asked

Viewed 488 times

3

I have an app that takes images from the gallery android, but on some devices the orientation of the image is changed, I would like to know how to maintain the original orientation of the image.

1 answer

1

When a new project is created, a file called Androidmanifest.xml is normally generated, in which you can configure the screen orientation of each created Activity, among other settings. Basically what you need to do is put on each tag "Activity" the android code:screenOrientation="Portrait", which it leaves the screen in portrait mode. Follow an example code:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.