Setup:
Screen 1: City Selection screen (home screen) Screen 2: Tabhost consisting of a map activity in one tab and a listview in another tab.Problem: When I access the map activity from the home screen the back button doesn't work. In fact it doesn't do anything. I'm even trying to see if it will receive any calls by overriding the "OnBackPressed" function...
@Override public void onBackPressed() { Log.d(TAG, "BACK BUTTON WAS PRESSED!"); super.onBackPressed(); }
Nothing comes up. It should go back to the home screen. I tried both on the emulator and my android device with the same result.
What does work
- When I launch the map on its own (not in a tabhost), the back button works fine
- When in the listview in tab 2, the back but开发者_如何学JAVAton works fine
Is it possible that something else is taking scope away from the mapview that might be accepting the onBackPressed event? I also tried to see if the activity that is holding the tabhost is accepting the onBackPressed event and it's not.
Any other thoughts anyone?
精彩评论