Skip to content Skip to sidebar Skip to footer

Android: Getmap() == Null Inside Dialogfragment

Im trying put a MapFragment inside a DialogFragment, it works fine but i dont know how can I wait until getMap()!=null... here´s my code: public class DialogMapa extends DialogFra

Solution 1:

So with the new maps framework, that call is not guaranteed to return non null. The map is pretty complex and is initializing a lot of state on and off the render thread.

In your case it's safe to call after onFragmentsResumed() or after the fragment is attached to an activity. You could always use a handler to check again some point later.

Solution 2:

Post a Comment for "Android: Getmap() == Null Inside Dialogfragment"