I have a mapview that I want to add some markers. I will extract them from the web service when I start my activity, so I need to know the minimum and maximum lat / lng pairs for the current viewport. I'm calling
mMapView.getWidth()
mMapView.getHeight()
But they both return 0 when the action begins. I tried putting it in onAttachedToWindow, onResume, onPostCreate, onPostResume, onStart etc., but to no avail. How can I find out that the activity is completed, having laid out all the looks and is ready to give me the correct measurements of height and width?
source
share