0

I am displaying the map like this:

    GoogleMap googleMap =  ((MapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap();

But, I am getting following error

The method getFragmentManager() is undefined for the type 
 MapActivity
ejaz dogar
  • 115
  • 3
  • 13

2 Answers2

1

First of all you need to extends your Activity by FragmentActivity, You can not use MapActivity with new Google map api v2. Second, you need to create map api key proper(i.e. debug key and live key both are different).

Pratik Dasa
  • 7,439
  • 4
  • 30
  • 44
0

Check if your target api is 11 or greater, but also check if libraries you use maybe target api 8. Check this: The method getFragmentManager() is undefined for the type MyActivity

Community
  • 1
  • 1
Zoran
  • 1,484
  • 1
  • 10
  • 13