title: Non static method error on back button
body: <p>I am trying to add a back button to app but when i add the code i get the "Non static method 'canGoBack() cannot be referenced from a static context" error.  I have read several stack articles about this error but have not been able to solve it.  Any ideas please?</p>
  
  <pre><code>package com.test;
  
  
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import android.app.Activity;
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.content.IntentFilter;
  import android.os.Bundle;
  import android.support.v4.content.LocalBroadcastManager;
  import android.util.Log;
  import android.view.KeyEvent;
  import android.view.Menu;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  import android.widget.Button;
  import android.widget.Toast;
  
  import com.parse.ParseInstallation;
  import com.parse.ParsePush;
  import com.parse.ParseQuery;
  import com.parse.PushService;
  
  public class MainActivity extends Activity implements OnClickListener {
  
      private Button push;
  
      private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
  
          @Override
          public void onReceive(Context context, Intent intent) {         
              Toast.makeText(getApplicationContext(), "onReceive invoked!", Toast.LENGTH_LONG).show();
          }
      };
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          PushService.setDefaultPushCallback(this, MainActivity.class);
  
  
          Button back = (Button) findViewById(R.id.back);
  
          WebView webView = (WebView) findViewById(R.id.webView1);;
          webView.getSettings().setJavaScriptEnabled(true);
          webView.loadUrl("http://www.xxxxx.xxxxxx.xxxxx.xxxx// ");
          webView.setWebViewClient(new WebViewClient());
  
  
          push = (Button)findViewById(R.id.senPushB);
          push.setOnClickListener(this);
      }
      private class Callback extends WebViewClient {
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              return (true);
          }
      }
  
  
  
      @Override
      public void onBackPressed()
      {
          if(WebView.canGoBack()){
              WebView.goBack();
          }else{
              super.onBackPressed();
          }
      }
      @Override
      public void onPause() {
          super.onPause();
  
          LocalBroadcastManager.getInstance(this).unregisterReceiver(mBroadcastReceiver);
      }
  
      @Override
      public void onResume() {
          super.onResume();
  
          LocalBroadcastManager.getInstance(this).registerReceiver(mBroadcastReceiver, new IntentFilter(MyCustomReceiver.intentAction));
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.activity_main, menu);
          return true;
      }
  
  
      @Override
      public void onClick(View v) {
  
          JSONObject obj;
          try {
              obj = new JSONObject();
              obj.put("alert", "hello!");
              obj.put("action", MyCustomReceiver.intentAction);
              obj.put("customdata","My message");
  
              ParsePush push = new ParsePush();
              ParseQuery query = ParseInstallation.getQuery();
  
              // Push the notification to Android users
              query.whereEqualTo("deviceType", "android");
              push.setQuery(query);
              push.setData(obj);
              push.sendInBackground(); 
          } catch (JSONException e) {
  
              e.printStackTrace();
          }
      }
  
  
  }
  </code></pre>