
100 Days of Exercise

Profile Creation Screen

The Date Selector
It’s been a fun project and I’m looking forward to adding a few things down the road. If you have any feedback, definitely drop me an email and let me know.
Tweet

100 Days of Exercise

Profile Creation Screen

The Date Selector
It’s been a fun project and I’m looking forward to adding a few things down the road. If you have any feedback, definitely drop me an email and let me know.
TweetIn an application I’m building for Android I use a lot of pop up windows (because that’s how Android does combo boxes) and I was having a tough time figuring out how to get them to close when the user pushes the back button. By default, the framework will call navigator.popView() whenever the back button gets pushed and the only way to override that is by doing it at the application level, which isn’t really ideal.
So here’s what I came up with.
Basically I intercept the removing event on the view, which is the last event that gets called before the view goes away. Using that event I check to see if any of my PopUps are on the screen using the isPopUp property and if they are, I use event.preventDefault() to stop the view from being removed and instead just remove the PopUp.
protected function view1_removingHandler(event:ViewNavigatorEvent):void { if(exerciseList.isPopUp) { PopUpManager.removePopUp(exerciseList); event.preventDefault(); } if(timeList.isPopUp) { PopUpManager.removePopUp(timeList); event.preventDefault(); } }
I’m not sure if this is really the best way to solve this issue, so if anyone has something that they’ve done I’d love to hear about it in the comments.
Tweet