I am developing an app of which all environment are in landscape.
Manifest.xml
<activity
android:name=".Main"
android:screenOrientation="landscape"/>
Main.java
public class Startup extends Activity implements AdListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
interstitialAd = new InterstitialAd(this, MY_PUBLISHER_ID); // Create an ad.
interstitialAd.setAdListener(this); // Set the AdListener.
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
interstitialAd.loadAd(adRequest);
Screenshots:
The Ad loads, but does not appear properly; there is a lot of white blank space at the bottom of the screen (under the ad), and it seems the ad is in portrait mode but chopped as shown below:
However, I discovered that if I GO OUTSIDE the app and set the system screen to be able to SCREEN AUTO_ROTATABLE
, then the ad can be displays properly like below:
Question:
I believe
interstitialAd
could support landscape? But how could that be modified?If the
interstitialAd
cannot be modified, how can I force the system to setSCREEN AUTO_ROTATABLE
to indirectly solve the problem?