开发者

Strange bug when launching Android app second time

So I am working on a simple android Tetris type game. On the first excecution of the app (from eclipse) everything works just as expected. However if I exit the app and launch it again from the phone this time I see a strange bug. There is a ghost piece that moves down the playing field, but is not actually visible. This piece causes problems because it affects the underlying grid so it takes up space, but is not actually visible. The app will keep generating these g开发者_开发知识库host pieces as well as the actual pieces the user should be seeing. It seems like the app is not entirely being killed when I exit. Any advice?


Have you overridden onPause() to properly clean up the pieces before the game exits?


You probably have some static variables. If you exit and enter again those statics will still hold the old values.

You can check it by calling System.exit(1) in onDestroy just for testing.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜