Java 如何在特定时间后自动关闭间隙广告?

Java 如何在特定时间后自动关闭间隙广告?,java,android,admob,Java,Android,Admob,我正在编写一个应用程序,并使用一个间隙广告单元(与谷歌AdMob)。 我想对其进行编程,使广告在特定时间后自动关闭广告。 这就是我所说的代码: private void showInterstitial() { // Show the ad if it's ready. Otherwise toast and reload the ad. if (mInterstitialAd != null && mInterstitialAd.isLo

我正在编写一个应用程序,并使用一个间隙广告单元(与谷歌AdMob)。 我想对其进行编程,使广告在特定时间后自动关闭广告。 这就是我所说的代码:

    private void showInterstitial() {
        // Show the ad if it's ready. Otherwise toast and reload the ad.
        if (mInterstitialAd != null && mInterstitialAd.isLoaded()) {
            mInterstitialAd.show();
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            //here I need to close the ad

您无法以编程方式关闭Admob Interstitual ad。Admob不允许开发人员以编程方式关闭间隙广告。只有用户可以通过单击“关闭”按钮或“上一步”按钮来关闭广告。

您无法通过编程方式关闭Admob间隙广告。Admob不允许开发人员以编程方式关闭间隙广告。只有用户可以通过点击关闭按钮或后退按钮来关闭广告