Why does startActivity work in one method and fail in another?
<p>I am an android beginner.</p>

<p>I'm struggling to understand why startActivity runs properly when copied from a tutorial I found and fails when I make the smallest change.</p>

<p>Code from the tutorial:<br /></p>

<pre>
private class ButtonHandler implements View.OnClickListener {
    public void onClick(View v) {
        handleButtonClick();
    }   
}

private void handleButtonClick() {
    startActivity(new Intent(this, SecondAct.class));
}
</pre>

<p>That works.  When I try to change it to what I would consider a simpler design, I am getting an error.</p>

<pre>
private class ButtonHandler implements View.OnClickListener {
    public void onClick(View v) {
        startActivity(new Intent(this, SecondAct.class));
    }   
}
</pre>

<p>The error is:<br />
The constructor Intent(FirstTwoApps.ButtonHandler, Class) is undefined</p>

<p>Notice that all I did was moved the action from the handleButtonClick() method to the onClick() method.  Apparently that is not allowed, but I don't understand why.</p>

<p>Any help is greatly appreciated.</p>
