i just learning about android programming to show map. but when i run this code ,there\'s some error. Can anybody explain why this error occurs? And what I can do to fix this pr
In your xml file change this
class="com.google.android.gms.maps.MapFragment"
to android:name="com.google.android.gms.maps.SupportMapFragment"
Extend your activity to FragmentActivty and change
map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
.getMap(); to
map= ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map)).getMap();
Also check
if (map== null)
{
map= ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map)).getMap();}
Hope this helps.