开发者

How to make a class that extends SurfaceView start an Activity?

开发者 https://www.devze.com 2023-02-07 03:05 出处:网络
So I have a class that draws and does all the lifting in my开发者_JAVA技巧 game, which extends SurfaceView.

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消