Android Question [SOLVED] WidgetService, 2nd module, layout View

pierrem

Member
Licensed User
Longtime User
Hi,

I have a WidgetService and during initialization it loads a layout file.
In this layout file, it is an ImageView named 'iLed', with filemane="green_led.png".
(in this layout, 2 files : green_led.png, red_led.png)
No problem, it works.

When the widget is clicked, a second activity is launched (file name : second).
In this second activity, the ImageView from the widgetservice is modified by the following code :
dim bm as BitMap
bm.Initialize(File.DirAssets,"red_led.png")
WidgetService.rv.SetImage("iLed",bm)

At runtime, an error is thrown :
java.lang.RuntimeException: java.lang.NoSuchFieldException: second_iled

It looks like (for me ...) that 'iled' is associated with 'second' file, despite the prefix 'WidgetService' used.

where is my mistake ?

Thank's in advance.

PS :
the Views in the layout file are not Dim declared in the WidgetService module ...
Should it be done ?
(as far as I recall, they're not in the tutos available on the site ...)
 
Last edited:

pierrem

Member
Licensed User
Longtime User
Ok,

I had allready seen this function, but because of it's name i imagined something about delay ... and decided not to investigate further

I keep learning
:)
 
Upvote 0
Top