×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2013
    Posts
    2

    Question Add list after showing form (hack for lwuit s40 list bug)

    Hi all,

    I'm using Tourist Attractions source code at link https://projects.developer.nokia.com...istAttractions
    Showing the main View(extend Form) AttractionView with function:
    Code:
    public void show(Guide guide) {
            this.guide = guide;
            attractionList.setGuide(guide);
            this.setTitle(guide.getCity());
            super.show(); //Form.show()
    
            // Add list after showing form (hack for lwuit s40 list bug)
            if (!this.contains(attractionList)) {
                addComponent(attractionList);
            }
            repaint();
        }
    Note that the form showed before attractionList(lwuit.List) was added.
    Above code work fine with nokia phone SDK but fail on other devices(not nokia phone, such as sun java wireless toolkit(WTK)).

    When using WTK, i add Thread.sleep(100000) before repaint();
    Code:
    public void show(Guide guide) {
            this.guide = guide;
            attractionList.setGuide(guide);
            this.setTitle(guide.getCity());
            super.show(); //Form.show()
    
            // Add list after showing form (hack for lwuit s40 list bug)
            if (!this.contains(attractionList)) {
                addComponent(attractionList);
            }
            try {
    			Thread.sleep(100000);
    		} catch (InterruptedException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
            repaint();
        }
    then it work fine in 100 seconds, i can increase this param but it is a bad ideal.

    So how can i fix it with WTK?

    Thanks & Best Regards
    Phung

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Add list after showing form (hack for lwuit s40 list bug)

    i suppose if you are working with Nokia Specific APIs then its not good to test that on other devices, you should use something more generic if your target is much broader !!

  3. #3
    Registered User
    Join Date
    Apr 2013
    Posts
    2

    Re: Add list after showing form (hack for lwuit s40 list bug)

    Hi gaba88,

    I like that code of Nokia because it very clear and easy to read. So i don't want to break its structure.
    If we can fix some codes of my issue to app not only run on Nokia device but also on others, then it so wonderful.

    Thanks in advance,
    Phung

Similar Threads

  1. How to identify List item in lwuit Form Screen?
    By pavanragi in forum Mobile Java General
    Replies: 6
    Last Post: 2012-08-08, 08:39
  2. How to append LWUIT List screen to a LWUIT Form in j2me?
    By pavanragi in forum Mobile Java General
    Replies: 1
    Last Post: 2012-08-06, 07:01
  3. lwuit list +sub list its need to show sub list
    By babu7575 in forum Mobile Java General
    Replies: 0
    Last Post: 2011-04-04, 14:12
  4. Images as list items & list as a component of a form
    By thijsman86 in forum Symbian User Interface
    Replies: 1
    Last Post: 2010-07-23, 20:00
  5. Replies: 15
    Last Post: 2009-01-19, 17:32

Posting Permissions

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