Android - new intent and activity problems
I'm developing an android app, and have developed a game, but I now have stupid problem. You control a UFO and when it's health will be reduced to zero the game should be over. How should I contruct gameOver?
Previous I've used an intent to open a new activity but this requires the class to开发者_运维问答 extend Activity, and since I want the mainthread to look up when the UFO has his health reduced to zero I can't just call GameActivity.gameOver since it want to use a static method to be called, and since a static method can't contain a new intent I can't figure it out.
A static method can contain an intent.
Pass a Context
in a param of the static method and use that to launch a new Context
.
精彩评论