Just came across this problem in my own app.
The solution that works for me is as follows:
onCreate(){
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
}
onPause(){
if (android.os.Build.VERSION.SDK_INT >= 27) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
}
}
onResume(){
if (android.os.Build.VERSION.SDK_INT >= 27) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
}
}
The above code should go in the activity that is in landscape mode (i.e. the second activity, and the one you press the back button from)
I would like to point out that this solution was not my own, and I have taken it from the #20 post at the following link (which is also noted in the OP):
https://issuetracker.google.com/issues/69168442
I just thought it might be easier for people to access if they don't have to search another page for it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…