Ad is not visible. Not refreshing add. Scheduling ad refresh 60000 miliseconds from now

后端 未结 2 1797
無奈伤痛
無奈伤痛 2020-12-19 16:02

I am having some CPU usage when my app is backgrounded and the only message I am receiving at Logcat is coming from Adview with the typical:

\"Ad is n

相关标签:
2条回答
  • 2020-12-19 16:33

    I was able to get this working . in my mainactivity have method call as below :

    private void checkAdd() { 
        mAdView = (AdView) findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder()
                .addTestDevice("8C7A47B9F0F8147BAD75D7DB4C2D026E")  // Will your Test device id.
                .build();
        mAdView.loadAd(adRequest);
    }
    @Override
    protected void onPause() {
        mAdView.pause();
        super.onPause();
    }
    
    @Override
    protected void onResume() {
        super.onResume();
        if(mAdView!=null){  // Check if Adview is not null in case of fist time load.
        mAdView.resume();}
    }
    
    0 讨论(0)
  • 2020-12-19 16:39

    I think you only need adView.pause(); in onPause() method:

    @Override
    protected void onPause() {
        adView.pause();
        super.onPause();
    }
    

    and adView.resume(); in onResume() method:

    @Override
    protected void onResume() {
        super.onResume();
        adView.resume();
    }
    

    Update: I think is an issue reported to google: https://groups.google.com/forum/#!topic/google-admob-ads-sdk/jz-ZQh86lm0

    0 讨论(0)
提交回复
热议问题