onCreate()
of SupportMapFragment
is too soon to be trying to manipulate the GoogleMap
, as it does not exist yet. You need to wait to a later point in time, when the GoogleMap
object exists, or leave the code where it is in your activity.
onViewCreated()
from your previous question should be a better choice than onCreate()
. However, I had made things too complicated in my answer. Replace:
karta = ((SupportMapFragment)getFragmentManager().findFragmentById(R.id.kontaktVisaFragment)).getMap();
with:
karta=getMap();