Android Question Error trying to run Widget Example

JohnC

Expert
Licensed User
Longtime User
I am running B4A 9.01 (yeah, I know it's older, but I don't have time to spend fixing 'gotchas' in all my projects if I update to 12.x).

I want to create a widget for an android 5.x device, so I downloaded the example from this page:


But when I try to compile it, I get the error "Error description: CreateRemoteViews can only be called inside a Service module.".

And if I try to run this example:


I will get the error:
B4X:
Error description: Object reference not set to an instance of an object.
Error occurred on line: 11
rv = ConfigureHomeWidget("4x1", "rv", 30, "Time in Letters", True)
Word: )

If this error is due to my version of B4A being older, how can I obtain a copy of the older widget example that will work with B4A 9.01?
 
Last edited:

JohnC

Expert
Licensed User
Longtime User
I just wanted to know if there was a quick way to get the older example because the device is android 5.0 as stated, but I did forget to mention that this will be a personal app, so the app is not bound by any restrictions of posting in google play store or newer android versions.

My main objective of getting this code is to see if I could use a webview in a widget, but it looks like I can't, so it's a moot point at this time.

NOTE: I understand your recommendation to use B4A 12, but I just don't have any spare time right now to "fix" things after I do the upgrade that are currently not broken with B4A 9.01. When I have some time to kill, I'll upgrade, I promise :)
 
Last edited:
Upvote 0
Top