How to call setRequestedOrientation() from ofApp.cpp?

Hi, I’m trying to limit available orientation in Android.
It works well by setting the below flag on manifest file.

android:screenOrientation=“portrait”

But I would like to set it by coding.
I found this question from the link below.

And it says I can set it with the following code.

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

But I have no idea how to call this method from ofApp.cpp file.
Can someone please teach me how to do it?
Thanks!

ofApp::setup()
{
    ofSetOrientation(OF_ORIENTATION_90_LEFT); // or OF_ORIENTATION_90_RIGHT
}
1 Like

Thank you @Hennio.
I didn’t know ofSetOrientation() calls setRequestedOrientation() internally.