Creating classes and using them into project
<p>I have a lot of button inside my application and for every button i need to create onClickListener, this will incerase line of code's.</p>

<p>So i create a class for onClickListener below:</p>

<pre><code>    import android.app.Activity;
    import android.content.Intent;
    import android.view.View;

    public class OnClickListener implements android.view.View.OnClickListener{

        Activity current;
        Class&lt;?&gt; goTo;

        public OnClickListener(Activity arg0, Class arg1){
            this.current = arg0;
            this.goTo = arg1;
        }

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(current, goTo);
        }

}
</code></pre>

<p>and now i want to go to next activity when button click's but when i put this line <code>startActivity(intent);</code> compiler shows error <code>The method startActivity(Intent) is undefined for the type OnClickListener</code></p>

<p>I dont know where i am going wrong and what i am missing. Please help me to solve this problem</p>
