Interstitial Admob ads: “IllegalStateException: Only fullscreen activities can request orientation”

前端 未结 7 734
故里飘歌
故里飘歌 2020-11-28 22:26

Background

I have an app with Admob SDK used in it, to show Interstitial ads (full screen ads).

Reccently Google has updated the SDK, along with many other

相关标签:
7条回答
  • 2020-11-28 22:44

    In Android Oreo You can't change the orientation by code so you have check whenever change the orientation


      if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
    
                    activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
                }
    
    0 讨论(0)
提交回复
热议问题