you should make some search before posting, I believe you can find number of examples well I think your problem is
Intent myintent = new Intent(this,MYclass.class);
change it to
Intent myintent = new Intent(YourCurrentActivityName.this,MYclass.class);