I was thinking this is probably just a problem with the emulator since it takes so long to start up the first time. If that the case, I wonder if something similar could ever happen on an android device?
On May 28, 9:49 pm, Yan <[email protected]> wrote: > I have six programs in the Android Market that require > android:screenOrientation="portrait" only. > > I just tested the "SDK Platform Android 3.1, API 12,revision2" and the > first time I run my apps it gives me the landscape widths long before > it give me theportraitwidths. Should I now put a delay in all my > programs to wait for the proper widths to arrive? This problem happens > for both ways I determine the width, that is: > > WindowManager window = getWindowManager(); > Display d = window.getDefaultDisplay(); > float width = d.getWidth(); > Log.d("TestUI"," window width=" + width); > > ...and... > > float width = (float) (canvas.getWidth()); > Log.d("TestUI"," canvas width=" + width); > > Here is the order the LogCat displays them: > > 05-29 03:17:19.420: DEBUG/TestUI(598): window width=1280.0 > 05-29 03:17:21.041: DEBUG/TestUI(598): canvas width=1280.0 > 05-29 03:17:21.440: DEBUG/TestUI(598): window width=800.0 > 05-29 03:17:21.740: DEBUG/TestUI(598): canvas width=800.0 -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

