views:

50

answers:

1

Following is simple html, when viewed on android browser(nexus one) results into continuos orientationchange event chain when you change phone's orientation just once.

<html><body>
<script type="text/javascript">
window.addEventListener("orientationchange",function(){alert("test");},false);
</script>
</body></html>
Can somebody please explain and suggest some workaround?

A: 

I think Falmarri means that by default that is what happens. You can prevent it from happening and listen for configuration changes in your activity, and then rotate the screen yourself, then the activity isn't restarted. See this series on rotation.

chad
I am not talking about activity orientation changes. Android browser app must have being implemented using some cool logic to achieve the best possible result. It's javascript's orientationchange event which ideally should have been taken care in a much cleaner way.
bhups