Stopping an intent from a thread and starting a new intent :Android
I've tried all weekend to find the answer to this, but I'm lost. I may have programmed myself into a hole, and need to do something different.
Imagine that my game launches into the main activity (the intro screen), then if the player wishes to view the whole continent a intent starts the Continent View Activity. If the player wishes to view the local city, then an intent starts the city view activity.
I can do this with buttons on the main intro screen, but I want the player to be able to select a the City Location on the Continent View. The result is to stop the intent for the Continent View and then trigger the activity for the City View.
The problem is, I don't seem to be able to call finish from the Thread (SurfaceView) that is drawing Continent View.
I don't really开发者_如何学JAVA want to make the Continent Map out of Buttons if I can help it. For now, the Continent View is made of .PNG cells.
Is my whole approach wrong?
Call post()
on your SurfaceView
with a Runnable
that calls finish()
.
精彩评论