android - Orientation problem -


we handling landscape , portrait in iphone , android

window.onorientationchange = function() { if(window.orientation == 0) { //loading portrait content , hiding landscape content } else if(window.orientation == -90 || window.orientation == 90) { //loading landscape content , hiding portrait content } }; 

problem while rotating taking time loading content

can me out fix issue.

chances improve performance using android api instead of own functions hiding , loading content when user rotates screen. if don't lock orientation, when user rotates phone activity destroyed , created again in new orientation.

if want load different resources in landscape , portrait mode, layout (although in res/ folder), put pertinent resource files in res/layout-land , res/layout-port under same filename. android load resources correct folder automatically. of course, should make habit of providing default resources whenever make resources specific state. if want portrait default orientation, put resources in res/layout , put landscape resources in res/layout-land. no res/layout-port folder needed.

see here full documentation: http://developer.android.com/guide/topics/resources/providing-resources.html#alternativeresources


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -