title: android starting Activity from Intent in onClickListener in common class returns error
body: <p>I have a navigation button that I use in each class and want to set its onClickListener in the class that contains all the common code. However I get a </p>
  
  <pre><code>"The method startActivity(Intent) is undefined for the type new View.OnClickListener(){}"
  </code></pre>
  
  <p>error in startActivity(i).</p>
  
  <p>The relevant code is:</p>
  
  <pre><code>    public static void initiateNavigationButton(Context context, View view, int layoutResource) {
      final Context classContext = context;
  
      LayoutInflater inflater = LayoutInflater.from(classContext);
      View layout = inflater.inflate(layoutResource, (ViewGroup) view);
  
      Button navigationButton = (Button) layout.findViewById(R.id.navigation_button);
  
      navigationButton.setOnClickListener(new View.OnClickListener() { 
          @Override
          public void onClick(View v) { 
              Intent i = new Intent(classContext, HomeActivity.class);
  
              startActivity(i); 
          }
      });
      }
  </code></pre>