Code, Code, Revolution!
If you’re building a somewhat complex NET TV application with multiple views and want an application like feeling you probably want to allow users to use the back button on the remote to navigate but still control the navigation paths instead of the default “web style” back functionality which makes absolutely no sense in an application. The problem is that if you hook the key event for the back button and redirect the user yourself you also make it impossible to get out of your application and back to the NET TV portal, well, not impossible, you can still hit the “Net tv”-button to get there. Still, the Philips engineers won’t appreciate this.
The solution is very simple. Using javascript you can pass the browser back and forward using the “window.history” object. When you want to close your application and send the user back to the portal screen, just call:
<script type="text/javascript"> // <![CDATA[ window.history.go(-1000000); // ]]> </script>
Pass the user one million pages back, unless the user has visited one million pages in your application he will end up on the NET TV-portal
With this blog I try to provide useful tips and solutions for programming .NET, Objective-C and more. My name is Björn Sållarp, and I love writing code.
Leave a reply