How to set Portrait and landscape when the APP is running ?
This is usually set by xml,This can only be set before the app runs.。
Thank you.
juce::android.getEnv();
juce::LocalRef activity (juce::android.activity.get());
These are no longer available in JUCE8
Java can no longer be called directly through jni
MyOrientationUtils.java::
//code…
package com.rmsl.juce;
package com.example.screenorientation;
import androidx.appcompat.app.AppCompatActivity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// 强制设置为横屏
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
}
