title: Onclick method not found in parent or ancestor context
body: <p>I get an error for a very simple thing. I have created a test button and an onClick method to just change the layout. I did it in a simple way so you could understand my problem better.</p>
  
  <p>This is my button method:</p>
  
  <pre><code> public void accountButton (View v){
      setContentView(R.layout.activity_start);
  }
  </code></pre>
  
  <p>And this is the xml file of my button:</p>
  
  <pre><code> &lt;Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Test"
      android:id="@+id/button"
      android:layout_below="@+id/welcomeTxt"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="149dp"
      android:onClick="accountButton"
      android:nestedScrollingEnabled="true" /&gt;
  </code></pre>
  
  <p>I get the following error when i click the button:</p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: Could not find method
    accountButton(View) in a parent or ancestor Context for
    android:onClick attribute defined on view class
    android.support.v7.widget.AppCompatButton with id 'button'</p>
  </blockquote>