×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    39

    getResourceAsStream problem ?!

    There is a call to getResourceAsStream in constructor of a class (MyCanvas) which is extended from FullCanvas.

    When I call it using MyCanvas.class.getResourceAsStream(), it works on prototype sdk 2 series 60 simulator, but application quits as soon as it run on n-gage.

    If I call it using getClass().getResourceAsStream(), it works.

    Why?

    MB

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    Use getClass() to get a reference to a class. You can't use the .class property in MIDP implementations - I think it needs an exception class that isn't in the MIDP API.

    Graham.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    39
    OK. I think I missed that, I havent read something about that in any documentation.

    Thanks Graham...

    Mete

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    I don't think it's mentioned anywhere! I found out the same way as you: I tried and it didn't work. I had to disassemble the bytecode to see why it wouldn't work.

    Graham.

Posting Permissions

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