android - Trying to make a map -


 private void setupmapifneeded() {     // null check confirm have not instantiated map.     if (mmap == null) {         // try obtain map supportmapfragment.         mmap = ((supportmapfragment) getsupportfragmentmanager().findfragmentbyid(r.id.map))                 .getmap();         // check if successful in obtaining map.         if (mmap != null) {             setupmap();         }     } } 

"for odd reason area says .getmap() isnt working. can help."

try removing .getmap() part , putting getmapasync() instead.

private void setupmapifneeded() {     // null check confirm have not instantiated map.     if (mmap == null) {         // try obtain map supportmapfragment.         mmap =((supportmapfragment)getsupportfragmentmanager().findfragmentbyid(r.id.map));         mapfragment.getmapasync(this);         // check if successful in obtaining map.         if (mmap != null) {             setupmap();         }     } } 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -