title: when user CloseAd then new Activity Start for multiple button [Facebook Interstitial Ad]
body: <p>I have multiple buttons on screen. I want to show <code>Interstitial Ad</code> when user click on <code>button</code> and when <code>Ad Closed</code> then go to new <code>activity</code> via intent.
  <strong>How can i do it? with facebook audience network.</strong></p>
  <blockquote>
  <p>For Admob this answer help a lot-
  <a href="https://stackoverflow.com/a/47229261/14566306">https://stackoverflow.com/a/47229261/14566306</a> . But this not work when
  we use Facebook audience network.</p>
  </blockquote>
  <p>Here is my Code-</p>
  <pre><code>import androidx.appcompat.app.AppCompatActivity;
  import androidx.appcompat.widget.Toolbar;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.widget.Button;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import com.facebook.ads.Ad;
  import com.facebook.ads.AdError;
  import com.facebook.ads.AdListener;
  import com.facebook.ads.AudienceNetworkAds;
  import com.facebook.ads.InterstitialAd;
  import com.facebook.ads.InterstitialAdListener;
  
  public class page1activity extends AppCompatActivity {
      String TAG = &quot;page1Activity&quot;;
      // for fb ads
      private final String TagAd = MainActivity.class.getSimpleName();
      public InterstitialAd interstitialAd;
      
      @Override
      protected void onDestroy() {
          if (interstitialAd != null) {
              interstitialAd.destroy();
          }
          super.onDestroy();
      }
      
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_home);
  
          // here call method
          setBtnClickListner();
          // fb ads 
          AudienceNetworkAds.initialize(this);
          funFbAds();
      }
  
      CardView Btn1Home, Btn2Home, Btn3Home, Btn4Home, Btn5Home,Btn6Home;
      private void setBtnClickListner(){
          Btn1Home =findViewById(R.id.btn1Home);
          Btn1Home.setOnClickListener(this);
  
          Btn2Home =findViewById(R.id.btn2Home);
          Btn2Home.setOnClickListener(this);
  
          Btn3Home =findViewById(R.id.btn3Home);
          Btn3Home.setOnClickListener(this);
      }
  
      @Override
      public void onClick(View v) {
          funIncSfCount();
          switch (v.getId()) {
  
              case R.id.btn1Home:
                  // importance of loan in AC
                  Intent intent1btn=new Intent(HomeActivity.this,page1activity.class);
                  startActivity(intent1btn);
  
                  break;
  
              case R.id.btn2Home:
                  // What is AC
                  Intent intent2btn=new Intent(HomeActivity.this,page2Activity.class);
                  startActivity(intent2btn);
  
                  break;
  
              case R.id.btn3Home:
                  // Term and condition for AC
                  Intent intent3btn=new Intent(HomeActivity.this,page3ActivityWebview.class);
                  startActivity(intent3btn);
  
                  break;
  
              default:
                  break;
          }
      }
      public void funFbAds(){
          interstitialAd = new InterstitialAd(this, &quot;1668688**********14076&quot;);
          // Create listeners for the Interstitial Ad
          InterstitialAdListener interstitialAdListener = new InterstitialAdListener() {
              @Override
              public void onInterstitialDisplayed(Ad ad) {
                  // Interstitial ad displayed callback
                  Log.e(TAG, &quot;Interstitial ad displayed.&quot;);
              }
  
              @Override
              public void onInterstitialDismissed(Ad ad) {
                  // Interstitial dismissed callback
                  Log.e(TAG, &quot;Interstitial ad dismissed.&quot;);
              }
  
              @Override
              public void onError(Ad ad, AdError adError) {
                  // Ad error callback
                  Log.e(TAG, &quot;Interstitial ad failed to load: &quot; + adError.getErrorMessage());
              }
  
              @Override
              public void onAdLoaded(Ad ad) {
                  // Interstitial ad is loaded and ready to be displayed
                  Log.d(TAG, &quot;Interstitial ad is loaded and ready to be displayed!&quot;);
                  // Show the ad
                  //interstitialAd.show();
              }
  
              @Override
              public void onAdClicked(Ad ad) {
                  // Ad clicked callback
                  Log.d(TAG, &quot;Interstitial ad clicked!&quot;);
              }
  
              @Override
              public void onLoggingImpression(Ad ad) {
                  // Ad impression logged callback
                  Log.d(TAG, &quot;Interstitial ad impression logged!&quot;);
              }
          };
  
          // For auto play video ads, it's recommended to load the ad
          // at least 30 seconds before it is shown
          interstitialAd.loadAd(
                  interstitialAd.buildLoadAdConfig()
                          .withAdListener(interstitialAdListener)
                          .build());
  
      }
    
  </code></pre>