如何在特定时间后自动关闭插页式广告?

Fea*_*ill 1 java android admob

我正在编写应用程序并使用插页式广告单元(使用 Google-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
Run Code Online (Sandbox Code Playgroud)

小智 5

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