How can I call the displayAd() method?

I am trying to execute an AdMob add via a trigger in a webView, but I can’t access the method. It keeps asking me to make the method static, but if I do that, I’m not able to access one of my variables.

MainActivity.java

 public class MainActivity extends AppCompatActivity {
     private InterstitialAd mInterstitialAd;
     private WebView mWebView;

     @Override
     protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_MainActivity);
          MobileAds.initialize(this, "ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX");
          mInterstitialAd = new InterstitialAd(this);
          mInterstitialAd.setAdUnitId("ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXX");
          mInterstitialAd.loadAd(new AdRequest.Builder().build());
          mWebView = (WebView) findViewById(R.id.MainActivity);
          mWebView.addJavascriptInterface(new WebAppInterface(this), "android");
     }

     public void displayAd() {
          [Ad Code Here]
     }
 }

WebAppInterface.java

 public class WebAppInterface {
      Context mContext;

      WebAppInterface(Context c) {
          mContext = c;
      }

      @JavascriptInterface
      public void ad() {
          MainActivity.displayAd();
      }
  }

This code will not work. How can I change it so that it works?

Try This.

public class WebAppInterface {
      Activity  mainActivity;

      WebAppInterface(Activity mainActivity) {
          this.mainActivity= mainActivity;
      }

      @JavascriptInterface
      public void ad() {
          mainActivity.displayAd();
      }
  }

and pass the activity reference to interface like

mWebView.addJavascriptInterface(new WebAppInterface(MainActivity.this), "android");