Android Question Widget mistery...


Active Member
Licensed User
Longtime User
I need some help before I start beleveing to ghosts and get completely crazy. some time ago I opened a case

but despite some good tips from @udg I could not find the problem and since it was not urgent I just decided to postpone the analisys.
last week end I had some time and restarted the investigation but I found some even more unexplicable (for me at least) behaviors.

the intial evidence was (as described in the initial post) and still is, that I could/I cannot update the widget. so if I add a view (say a label) in the bal file and then in the widget service I call a rv.settext for that label the widget complains that the view does not exist issuing :

Widget Error:(NoSuchFieldException) java.lang.NoSuchFieldException: widgetservice_label1

so I thought...ok let's rename the bal file and update the rv = ConfigureHomeWidget("l1", "rv", 60, "My Widget") call. but I had the same result..

now the craziest thing: one of the worlking views in the widget is named "lblAlertsCounter" and it is referenced as such in the SetText code as rv.SetText("lblAlertsCounter","0"). so I opened the l1.bal layout file and renamed that label to "lblAlertsCounterx"..surprisigly the rv.SetText("lblAlertsCounter","0") still now I am pretty sure:

the widget is using some other layout file and not the one I call in the rv = ConfigureHomeWidget("l1", "rv", 60, "My Widget").

What can I do to try to understand what is the widget using as layout file?
thanks for any suggestion..


Active Member
Licensed User
Longtime User
Have you tried 'cleaning' the project? I've seen this type of problem in B4R and cleaning usually helps - don't know if it's the same with B4A.
Upvote 0