after few days of freaking out and ugh frustrate thinking my API key is wrong, i found out that my MapView will load in my application only when its the main content of the
The activity that, in the end, hosts a MapView
must be a MapActivity
, at least in the current incarnation of the Maps add-on for Android.
This can cause confusion, or outright problems, where you are trying to have the activity be something else.
For example, some people try to use a TabActivity
, and use activities as the contents of tabs. That is officially deprecated now, and IMHO was never an especially good model in the first place. When it comes to maps, even if the activity you try loading into the tab is a MapActivity
, that does not really matter -- the activity containing the tabs must be a MapActivity
. The common workaround is to use TabHost
and TabWidget
in a MapActivity
. While this does require a call to setup()
on the TabHost
, and you lose some helper methods, it gets past this problem.