facebook

Start application from checkpoint: CLOSED

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #351464 Reply

    Philip!!!
    Member

    Hi Octavio

    I have a question for you.

    I developed a book application,

    the first time i open the application it starts from my start up screen,
    now, i want after i close the application and open it again to start
    from the screen i was last time.

    how can i implement something like that?

    #351477 Reply

    Hi philip,

    You can achieve this by saving a variable in local storage, everytime you change to a new screen (phoneui.postPageTransition funtcion) overwrite this var and add the code (phoneui.documentReadyHandler) to navigate to a screen depending on value saved on localstorage var. Let me know if you need further assistance.

    #351487 Reply

    Philip!!!
    Member

    Hi Octavio

    I’m sorry , when you say local storage , do you mean my custom.js ?

    is it possible to post an example because i am new to this ?

    Thank you
    Philip

    #351504 Reply

    Hi philip,

    For local storage take a look at this example: http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=2251

    For transitions something like this should work:

    phoneui.postPageTransition = function(newScreenId) {
             localStorage.setItem("lastscreen","products");
    }
    
    phoneui.documentReadyHandler = function() {
         if(localStorage.getItem("lastscreen")=="products"){
             phoneui.gotoScreen('m1-products', 'FADE');
        }
    }
    #351505 Reply

    Philip!!!
    Member

    Hi Octavio

    I’m sorry but i am a bit confused

    Am i suppose to add the code to my custom.js file in my project folder
    or add the local storage custom.js file in my project folder?

    #351543 Reply

    Philip!!!
    Member

    Hi Octavio
    I haven’t got a feed back from you yet.

    If you think we are not on the same page here on what i am trying to do
    exactly i can always share a folder with a sample of my application with you
    ( in privet of course) so you understand better my problem.
    just send me an email or a link.

    Philip

    #351551 Reply

    Hi Philip,

    I am discussing the best approach with the dev team, will follow up with a small sample project asap.

    #351554 Reply

    Philip!!!
    Member

    Great ill be waiting,
    i the meantime i will post another topic for a problem i ‘m having.

    #351742 Reply

    Philip!!!
    Member

    Hi octavio

    Any news yet?

    #351761 Reply

    Hi Richard,

    Sorry for the delay. I am sharing an example in a couple hours more 🙂

    #351766 Reply

    Hi philip,

    Here is the example I promised. Note that the back button doesn’t work if your last active screen is a secondary screen, so I suggest you to avoid them.

    phoneui.postPageTransition = function(newScreenId) {
    
            localStorage.setItem("lastscreen",newScreenId);
    }
    
    phoneui.documentReadyHandler = function() {
        
        var lastscreen = localStorage.getItem("lastscreen");
        
        if(lastscreen!=undefined||lastscreen!="#m1-home")
        {
            phoneui.gotoScreen(lastscreen, 'NONE');
        }
            
    }

    Ping me if you need further assistance.

    Attachments:
    You must be logged in to view attached files.
    #351810 Reply

    Philip!!!
    Member

    Hi Octavio

    It worked and helped me a lot.

    #351822 Reply

    Hi philip, glad to help. I have closed the thread.

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: Start application from checkpoint: CLOSED

You must be logged in to post in the forum log in