surfaceview orientation without main.xml or androidmanifest.xml
I would like to change the orientation of my SurfaceView from landscape to portrait. I'm doing this without the use of main.xml (rendering it using only java code) and I would like to know how. Most of the questions here deal with camera orientation, but I would like to know if it's possible to play video in portrait instead of l开发者_开发百科andscape through the SurfaceView. Do I use onMeasure() or onLayout()? Any other functions work? Thanks
BTW I have implemented changes in main.xml and androidmanifest.xml, but they have not worked. I also used setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); but does not work as well.
I found that using
int setOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
works.
精彩评论