Ticket Created
over 4 years ago

WERETECH - 10116

Code crash only when type = widget

Hi,

I copied a code base for an app in eclipse using latest compiler. 

I made a few changes to the code... adding glance view, annotating widget view, updated the xml to type = widget...

When I run it as a widget it crashes in the widget initialise function. If I keep commenting out lines the failure moves down the function code. The error is not very helpful

Error: Illegal Access (Out of Bounds)
Details: Failed invoking <symbol>
Stack:
- initialize() at HRVWidget.mc:228 0x100005e7

If I now set the manifest type to "App" the code runs fine. So no code changes!

Any ideas welcome as beating head against a brick wall on this one.

Regards,

David

Parents
  • Many thanks Travis. I hadn't appreciated that I needed to bring everything on the code path for a glance into "scope". I had assumed that annotating things with :glance was an exclusive function ie they would only appear in the glance scope and not in the app/widget as well. (Sorry if the terminology is wrong).

    To maybe say it another way: all functions and resources are in scope of the app/widget but only those annotated with :glance are in scope of the glance itself. In addition the code needs to be annotated such that the widget or glance functions and resources during each lifecycle are available as they essential overlay each other.

    I solved it by refactoring the code but now I understand this I may revert and annotate it correctly.

    Regards,

    David

Comment
  • Many thanks Travis. I hadn't appreciated that I needed to bring everything on the code path for a glance into "scope". I had assumed that annotating things with :glance was an exclusive function ie they would only appear in the glance scope and not in the app/widget as well. (Sorry if the terminology is wrong).

    To maybe say it another way: all functions and resources are in scope of the app/widget but only those annotated with :glance are in scope of the glance itself. In addition the code needs to be annotated such that the widget or glance functions and resources during each lifecycle are available as they essential overlay each other.

    I solved it by refactoring the code but now I understand this I may revert and annotate it correctly.

    Regards,

    David

Children
No Data