android - Why MapView returns null if not logged into Google Play Account? -
i created fragment mapview
, works fine if user logged google play account. if reset device , launch application, crashes when initialize mapview.
map = mapview.getmap();
why happen? , in order prevent crash, should check if user logged google account?
from documentation
it returns googlemap. null if view of map not yet ready. can happen when google play services not available. if google play services becomes available afterwards, calling method again initialize , return googlemap.
and can not access google services until did not logged-in play.
although method googlemap getmap () has been deprecated, should use getmapasync (onmapreadycallback callback)
Comments
Post a Comment