title: Android Webview Goback
body: <p>I have been trying to compile an Android app but I am getting error saying that </p>
  
  <blockquote>
    <p>java: non-static method <code>canGoBack()</code> cannot be referenced from a static context<br>
    java: non-static method <code>goBack()</code> cannot be referenced from a static context  </p>
  </blockquote>
  
  <p>So basically I was trying to integrate airpush in this app but I am having with the <code>goback()</code> function... I want it execute the <code>airpush.startLandingPageAd();</code> on exiting the app (When there is no more history... </p>
  
  <pre><code>package bizkit.app1;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.webkit.WebChromeClient;
  import android.webkit.WebView;
  import android.view.KeyEvent;
  import com.djtjetyj.dghwdgh54656.Airpush;
  
  public class FengShuiTips extends Activity {
      private Airpush airpush;
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          WebView webView = (WebView)findViewById(R.id.webView);
          webView.getSettings().setJavaScriptEnabled(true);
          webView.setWebChromeClient(new WebChromeClient());
          webView.loadUrl("https://www.google.com");
          Airpush airpush=new Airpush(getApplicationContext(), null);
          airpush.startPushNotification(false);
      }
  
      @Override
      public boolean onKeyDown(int keyCode, KeyEvent event) {
          if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; WebView.canGoBack()) {
              WebView.goBack();
              return true;
          }
          airpush.startLandingPageAd();
          return super.onKeyDown(keyCode, event);
      }
  }
  </code></pre>