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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -