(I have got class MainActivity (extends Activity) and there I have got method setContentView(GameView);
GameView is a class which extends View and in this class (GameView) I have got method:
boolean inTouchEvent(MotionEvent event){
switch(event.getAction()){
case MotionEvent.ACTION_DOWN:
//here I would like to go to another activity to class MainMenuActivity()
}
}
Thanks in advance.
Ok it’s work:
public boolean onTouchEvent(MotionEvent event){
switch(event.getAction()){
case MotionEvent.ACTION_DOWN:
Intent intent = new Intent (contexTmp, MainActivity.class);
contexTmp.startActivity(intent);
((Activity)getContext()).finish();
}
}
To go to another activity: