开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜