android - setDisplayOrientation changes upon onResume() -
i'm using camera , have in portrait mode app
camera.setdisplayorientation(90);
when activity goes background , comes display orientation 0 aka landscape, when try setdisplayorientation(90) again fails , throws error (possibly because final).
how maintain camera being in portrait aka 90degrees mode?
also have support 2.2 , higher can use api 8
per android api documentation, prior api level 14 not allowed set orientation while preview active: setdisplayorientation() reference.
i'm guessing need call stoppreview()
, set desired orientation, , call startpreview()
.
Comments
Post a Comment