×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    18

    Display NOT displaying...

    Hi all,

    If anybody can explain whey this code is not showing the form while log in is being done, I'll really appreciate it...

    else if(displayable == LoginScreen) {
    if ( command == okCommand ) {
    display.setCurrent(loginWaitScreen);
    validateUser(User.getString(), Password.getString());}
    else {destroyApp(true);}

    I want to do the log in in a seperate thread, while the user sees the loginWaitScreen, which is a simple form.

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Display NOT displaying...

    Quote Originally Posted by zkidron View Post
    Hi all,

    If anybody can explain whey this code is not showing the form while log in is being done, I'll really appreciate it...
    display.setCurrent(loginWaitScreen);
    I want to do the log in in a seperate thread, while the user sees the loginWaitScreen, which is a simple form.
    Hello zkidron,
    Welcome to the forum Nokia developers discussions board.

    Are there any error exception on the device/emulator?
    Are you sure that you have created the same?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    18

    Re: Display NOT displaying...

    Hi Raj,

    Thanks for the welcome,

    No exceptions, no errors, application runs as intended BUT the wait screen never displays.

    Log in is done in the other thread and goes well, communicates with server and allows/blocks access to app as it was designed to do.

    Notice I change display to the Wait Screen in CommandAction, before initiating the Log in Thread.

    I know display.setCurrent is a request only with no guarantee for timing of display change. But even when login thread delays
    for 2-3 seconds (due to over the air communications) this wait screen never shows up and I go directly to my app main menu.

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Display NOT displaying...

    Hello zkidron,

    could you please elaborate how you reproduce this Display issue: what tools and devices do you use?

    In case of Series 40, have you checked this basic design consideration article on Forum Nokia Wiki (esp. regarding 'Code optimization: the right way with startApp()') ?: Series_40: Considerations regarding MIDlet startup and runtime execution

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  5. #5
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Display NOT displaying...

    Yeah,Kindly come with the more details about that Display issue.
    and why are you checking the condition
    else if(displayable == LoginScreen)
    ,when you are handling the display as per the command.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Display NOT displaying...

    If you're processing an event (like startApp(), commandAction(), keyPressed(), etc.), Display.setCurrent() will have no effect until you return from the event method. If you change the Displayable twice while processing the same event, then only the second Displayable will appear.

    Graham.

  7. #7
    Regular Contributor
    Join Date
    May 2007
    Location
    India
    Posts
    208

    Re: Display NOT displaying...

    Are you sure that your loginWaitScreen object gets successfully created? Are you able to display it anywhere else in app? You can also try to insert a delay of 5 secs between the two threads to see if it makes any difference.

  8. #8
    Registered User
    Join Date
    Feb 2010
    Posts
    18

    Re: Display NOT displaying...

    OK guys, thanks for all the advice, let me answer in order:

    1. Checked the article referenced by r2j7 and I designed my app in accordance with those suggestions. No problem there. When the problem presents itself I've already finished with startApp();

    2. I'm using Netbeans 6.5.1 + WTK 2.5.2 for development and testing on N95(S60 3rd) and 2610(S40). Get same results in emulators and actual devices.

    3. Raj: My app does startApp() and then goes to a login screen displayable to collect from the user his user name and password. So when the user chooses OK command I want to display the wait screen and go to my validateUser() method which start a separate thread that authenticates the user with my server (which works fine). I tried to display my wait screen from validateUser() with same result as when doing it from CommandAction.

    4. Graham: I know. But it NEVER takes effect. No matter if I call it from CommandAction or from validateUser().

    5. 007: I'll test (delay and display form in another place) but it's a VERY simple Form and all my forms so far had no issues like this.

    Thanks for the help guys, I appreciate the interest in my problem

  9. #9
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Display NOT displaying...

    Can't tell you more from that small fragment of code. Would need to see the entire method.

    Graham.

  10. #10
    Registered User
    Join Date
    Feb 2010
    Posts
    18

    Re: Display NOT displaying...

    Graham,

    Can you please remind me how to format posts so that code displays correctly?

    Thanks

  11. #11
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Display NOT displaying...

    Put [ code ] [ /code ] (without the spaces) around it.

    If you can cut the code down to the smallest possible sample that reproduces the problem, that would help.

    Graham.

  12. #12
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Display NOT displaying...

    could it be that the main UI-Thread is blocked/busy someway ?
    Are you doing any (length/heavy) operation which is not in it's own Thread ?

  13. #13
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Display NOT displaying...

    Raj: My app does startApp() and then goes to a login screen displayable to collect from the user his user name and password. So when the user chooses OK command I want to display the wait screen and go to my validateUser() method which start a separate thread that authenticates the user with my server (which works fine). I tried to display my wait screen from validateUser() with same result as when doing it from CommandAction.
    Are you displaying the wait screen inside the thread?
    Are you validation the user credentials inside the thread?
    is your waiting screen just coming and then its not getting hide or it just not come at all?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  14. #14
    Registered User
    Join Date
    Feb 2010
    Posts
    18

    Re: Display NOT displaying...

    Thanks guys, you made me think and as usual that tends to lead to positive results :-)

    I was calling the display change from within CommandAction. Until the next method returns, the one called from commandaction immediately after, there will be no display change.

    Another lesson I learned through this valuable forum and it's members.

    All is working nicely now.

Similar Threads

  1. Recording in Amr Format
    By losym in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-03-26, 06:41
  2. Arabic Display Issue in Nokia Mobiles
    By hooopoe in forum Mobile Java General
    Replies: 2
    Last Post: 2009-02-02, 09:12
  3. how do display accents with CFont?
    By zeinab_b in forum Symbian
    Replies: 1
    Last Post: 2008-07-14, 10:47
  4. Display question ...
    By kapot in forum Mobile Java General
    Replies: 0
    Last Post: 2002-10-14, 22:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×