I have an ImageView which will display an image from the web. I used a AsyncTask to load the image and render the image in the onPostExecute event of the AsnycTask. The image loaded from the web may be very large in size, and cannot be decoded in a phone, so I have to know the size of the image view and re-size the image at run-time.
The View class has getWidth and getHeight methods, but I do not know when it is safe to invoke them. I tried to call these methods in the containing Fragments' onCreateView event, but both return 0; if I call these methods in the onPostExecute event of the AsyncTask, the return value is non-zero and correct.
So I am thinking when is the best point to call these methods and get the view's size.