First You have to use this code in MainActivity.java class
@Override
public void onClick(View v)
{
// TODO Auto-generated method stub
Intent i = new Intent(getApplicationContext(),NextActivity.class);
startActivity(i);
}
You can pass intent this way.
Second
add proper entry into manifest.xml
file.
<activity android:name=".NextActivity" />
Now see what happens.