I'm getting a null pointer exception when I subclass an OnClickListener()
<p>I'm trying to subclass one of my <code>OnClickListener()</code> 's and I'm getting a 'null pointer' exception, but I'm not sure why.. I'm going nuts over this.. any help would be greatly appreciated..</p>

<p>Here is the code in my Utilities Class located in com.Tools</p>

<pre><code>public class Utilities 
{
public static View.OnClickListener CreateOnClickListener(final Context context,final Class&lt;?&gt; cls)
{
    final Activity act = new Activity();
    View.OnClickListener listener = new View.OnClickListener() 
    {
            public void onClick(View v) 
            {
                Intent window = new Intent(context, cls);
                act.startActivity(window);
                act.finish();
            }
    };

    return listener;
}
}
</code></pre>

<p>And when I call it from my main class I do this:</p>

<pre><code>final Button button1 = (Button) findViewById(R.id.button1);
button1.setOnClickListener(Utilities.CreateOnClickListener(MainMenu.this, SettingsMenu.class));
</code></pre>

<p>When I debug, the exception occurs on this line:</p>

<pre><code>act.startActivity(window);
</code></pre>

<p>Any ideas??? Thank you very much in advance!!!</p>
