onClick does not find its method
<p>When I click a button, its method does not get called, but exception is thrown. Why?</p>

<pre><code>Caused by: java.lang.NoSuchMethodException: myMethod [class android.view.View]
</code></pre>

<p>main.xml:</p>

<pre><code>android:onClick="myMethod"
</code></pre>

<p>Activity:</p>

<pre><code>public class MyActivity extends Activity {
//onCreate etc

    public void myMethod() {
    }
}
</code></pre>
