×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    101

    Canvas.getHeight() returning different values on the Nokia 7650

    I have two similar MIDlets that return different values for Canvas.getHeight() on the Nokia 7650. In one of the MIDlets, getHeight() returns 144; in the other, it returns 164. In the MIDlet that gets 164, the content at the bottom of the Canvas is not visible, implying that 164 is not the correct value. Both MIDlets get 144 as the height when using the Nokia Series 60 MIDP emulator.

    What makes the phone return different values for getHeight()? In both my MIDlets, I'm calling getHeight() in the Canvas-derived class's constructor, so it seems unlikely that the presence or absence of Commands (always added after the constructor returns) would make the difference.

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    88

    RE: Canvas.getHeight() returning different values on the Nokia 7650

    Hi,

    I have exactly same problem, on emulator and old Nokia firmware (possible 3.06, I am not sure) getHeight() return 144 in any case, but on device with newest (3.12) it return 164, this effect become if I construct canvas after calling and displaying splash screen, if I first constructing main canvas and call getHeight() before displaying this one and splash, it return propertly 144.

    regards Dmitry

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    Luton, Bedfordshire, UK
    Posts
    29
    I have two midlets in the *same* midlet suite that display this behaviour: one seems to have a correct canvas height of 144 while the other reports an incorrect 164. There are enough differences between the two for me to feel uneasily that the results of a call to getHeight might be different after the constructor, or after the canvas has been displayed, or after a command has been added to it, despite the fact that the MIDP documentation swears it doesn't change within the course of an application.

    This must surely be a FAQ by now (except that I can't find any mention of it in the FAQ!). I notice that these posts are quite old -- has anybody found out what is going on?

Posting Permissions

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