0
votes

I am having problem in navigating back to my previous view in flex 4.5 mobile application.

In the main application file(under src//default), I have created a back button in the action content so, that be in any view. I can see then and go back to my previous view.

I am using navigator.popView(); when the back button is pressed.

However, it goes to a blank screen But however, if you use the emulator's back button it goes back to a previous view. I am using navigator.pushView to move to a next view.

Any help, appreciated

3

3 Answers

1
votes

I found the solution. using:

navigator.activeView.navigator.popView();
0
votes

before you navigate to next view , try to use push method i.e. this.navigate.pushView(Viewname,contenttouse_in_next_Screen,"stattuscontext");

whenever you pop from current view you will get back to previous view...

0
votes

I had the same problem. I think that the application firstview didn't get stacked in navigator in Android.

I used a small trick. I created some blank view (test.mxml). Then I did:

ViewNavigatorApplication's firstView=test.mxml

test.mxml only has a preinitialize event listener which has navigator.pushView([original firstView]).

Examples:

----MainApplication.mxml

<s:ViewNavigatorApplication 
   xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark" 
   firstView="Test">

----Test.mxml

<s:View 
   xmlns:fx="http://ns.adobe.com/mxml/2009" 
   xmlns:s="library://ns.adobe.com/flex/spark"
   preinitialize="eventPreinitialize();">
   <fx:Script>
      <![CDATA[
         private function eventPreinitialize():void{
            navigator.pushView(OriginalFirstView);
         }
      ]]>
   </fx:Script>
</s:View>

----OriginalFirstView.mxml

<s:View 
   xmlns:fx="http://ns.adobe.com/mxml/2009" 
   xmlns:s="library://ns.adobe.com/flex/spark">
   <fx:Script>
      <![CDATA[
         //have variable actions
      ]]>
   </fx:Script>
</s:View>