Search code examples
androidadmobpreloadinterstitial

How to notify user before loading Interstitial Ad


Currently in my application I am showing ad when user click on button or move to new activity, what I want to do is notify user before loading ad. I want to show message like Ad is loading...! and after 2-3 sec that msg should disappear. In short I want to show dialog on preload of ad. I was trying this with help of alert msg but that is not working, I am not sure where we need to add alert dialog.

Please help...!

Thanks in Advance...!


Solution

  • I achieved this by using following code

    /* Show your dialog */
    
        ShowDailog();
    
    /* following code will run after 3000ms */
    
        new Handler().postDelayed(new Runnable() {
    
                            @Override
                            public void run() {
                                // TODO Auto-generated method stub
                                showInterstitial();
                            }
    
                        }, 3000);