How to make a class that extends SurfaceView start an Activity?
So I have a class that draws and does all the lifting in my开发者_JAVA技巧 game, which extends SurfaceView. I want to start a new Activity that shows the score of the player after he dies. The GameOver activity has the score. How do I do this?
Context context = getContext(); // from MySurfaceView/Activity
Intent intent = new Intent(context, GameOver.class);
context.startActivity(intent);
精彩评论