且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

安卓:景观儿童活动在人像选项卡活动

更新时间:2022-05-13 07:08:35

我面临同样的问题。不知道如果这是一个很好的解决方案,但我发现了解决方法如下:
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 的setContentView() 中的onCreate( )活动C.方法并把 this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); 的setContentView()另外两个活动(A和B)。

I faced the same problem. Dont know if it is a good solution, but the workaround I found is as follows: Put this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); before the setContentView() of onCreate() method of Activity C. And put this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); before the setContentView() of onCreate() method of other two Activities (A and B).

任何其他的解决方案是非常AP preciated。

Any other elegant solution is highly appreciated.